Skip to content

Commit 0350d78

Browse files
committed
- Docker: Move environment variables out of the docker-compose.yml and added a command to the Dockerfile to copy .env_template to .env
1 parent d41165e commit 0350d78

File tree

3 files changed

+3
-43
lines changed

3 files changed

+3
-43
lines changed

docker-compose.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,6 @@ services:
1717
build:
1818
context: ./server
1919
dockerfile: Dockerfile
20-
environment:
21-
- NODE_ENV=prod
22-
23-
# Postgres DB Connection Parameters
24-
- DB_HOST=db
25-
- DB_NAME=postgres
26-
- DB_PORT=5432
27-
- DB_USERNAME=postgres
28-
- DB_PASSWORD=password
29-
- DB_SCHEMA=public
30-
31-
# Node/Express API Port
32-
- API_PORT=8000
33-
- TOKEN_SECRET=myappsecret
34-
35-
# Image comparison options
36-
- PIXELMATCH_PROCESSING_THRESHOLD=0.0
37-
- PIXELMATCH_OUTPUT_ALPHA=0.6
38-
- CAPTURE_IMAGE_HEIGHT=5000
39-
- CAPTURE_IMAGE_WIDTH=1024
40-
41-
# Option for saving screenshots locally or to AWS S3
42-
- FILESYSTEM=LOCAL
43-
- DOMAIN=api
44-
45-
# Required if FILESYSTEM=S3
46-
- S3_BUCKET=
47-
- AWS_ACCESS_KEY_ID=
48-
- AWS_SECRET_ACCESS_KEY=
49-
50-
# Mail Notification Options
51-
- MAILSYSTEM=SMTP #SMTP or SES
52-
- EMAIL_FROM=myemail@email.com
53-
54-
# Required if MAILSYSTEM=S3
55-
- SES_ACCESS_KEY=
56-
- SES_ACCESS_SECRET=
57-
58-
# Required if MAILSYSTEM=SMTP
59-
- SMTP_HOST=smtp.mailgun.org
60-
- SMTP_PORT=587
61-
- SMTP_USER=
62-
- SMTP_PASSWORD=
6320

6421
ports:
6522
- 8000:8000

server/.env_template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
NODE_ENV=prod
2+
13
# Postgres DB Connection Parameters
24
DB_HOST=db
35
DB_NAME=postgres

server/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ RUN set -x \
1616

1717
WORKDIR /app
1818
COPY . .
19+
COPY /.env_template .env
1920
RUN npm i --production
2021
CMD ["pm2-runtime", "pm2.config.js"]

0 commit comments

Comments
 (0)