-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Docker: Move environment variables out of the docker-compose.yml an…
…d added a command to the Dockerfile to copy .env_template to .env
- Loading branch information
Showing
3 changed files
with
3 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,49 +17,6 @@ services: | |
build: | ||
context: ./server | ||
dockerfile: Dockerfile | ||
environment: | ||
- NODE_ENV=prod | ||
|
||
# Postgres DB Connection Parameters | ||
- DB_HOST=db | ||
- DB_NAME=postgres | ||
- DB_PORT=5432 | ||
- DB_USERNAME=postgres | ||
- DB_PASSWORD=password | ||
- DB_SCHEMA=public | ||
|
||
# Node/Express API Port | ||
- API_PORT=8000 | ||
- TOKEN_SECRET=myappsecret | ||
|
||
# Image comparison options | ||
- PIXELMATCH_PROCESSING_THRESHOLD=0.0 | ||
- PIXELMATCH_OUTPUT_ALPHA=0.6 | ||
- CAPTURE_IMAGE_HEIGHT=5000 | ||
- CAPTURE_IMAGE_WIDTH=1024 | ||
|
||
# Option for saving screenshots locally or to AWS S3 | ||
- FILESYSTEM=LOCAL | ||
- DOMAIN=api | ||
|
||
# Required if FILESYSTEM=S3 | ||
- S3_BUCKET= | ||
- AWS_ACCESS_KEY_ID= | ||
- AWS_SECRET_ACCESS_KEY= | ||
|
||
# Mail Notification Options | ||
- MAILSYSTEM=SMTP #SMTP or SES | ||
- [email protected] | ||
|
||
# Required if MAILSYSTEM=S3 | ||
- SES_ACCESS_KEY= | ||
- SES_ACCESS_SECRET= | ||
|
||
# Required if MAILSYSTEM=SMTP | ||
- SMTP_HOST=smtp.mailgun.org | ||
- SMTP_PORT=587 | ||
- SMTP_USER= | ||
- SMTP_PASSWORD= | ||
|
||
ports: | ||
- 8000:8000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
NODE_ENV=prod | ||
|
||
# Postgres DB Connection Parameters | ||
DB_HOST=db | ||
DB_NAME=postgres | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0350d78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
Doesn't this change affect how easy it is to change variables after you deploy?
0350d78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladiiancu - that's a good point. I believe we could still override the variables in the compose file if needed, but it would not be as easy. A good compromise might be to add a reference from the compose file to the .env_template to provide this flexibility. Let me know your thoughts.
e.g.
api:
env_file:
- ./server/.env_template
0350d78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that yes. As long the app is aware of the changes (without the need to restart)
0350d78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladiiancu - the app server will always need to restarted because the environment variables are picked up when the nodeJS starts up.