Skip to content

Commit 798b436

Browse files
authored
Set Docker variables in .env file (#26)
1 parent ec60568 commit 798b436

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.env-example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
POSTGRES_USER=fexservice
2+
POSTGRES_PASSWORD=password
3+
POSTGRES_DB=fexservice
4+
FEXAPI_DATABASE_URL=postgresql://fexservice:password@db/fexservice
5+
FEXSERVICE_DATABASE_URL=postgresql+psycopg2://fexservice:password@db/fexservice

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
depends_on:
1515
- "db"
1616
environment:
17-
- DYNACONF_DATABASE_URL="postgresql://fexservice:password@db/fexservice"
17+
- DYNACONF_DATABASE_URL=${FEXAPI_DATABASE_URL}
1818
volumes:
1919
- ./fexapi:/fexapi
2020
ports:
@@ -28,17 +28,17 @@ services:
2828
depends_on:
2929
- "db"
3030
environment:
31-
- DYNACONF_DATABASE_URL="postgresql+psycopg2://fexservice:password@db/fexservice"
31+
- DYNACONF_DATABASE_URL=${FEXSERVICE_DATABASE_URL}
3232
volumes:
3333
- ./service:/service
3434

3535
db:
3636
image: postgres:12.1
3737
restart: always
3838
environment:
39-
- POSTGRES_USER=fexservice
40-
- POSTGRES_PASSWORD=password
41-
- POSTGRES_DB=fexservice
39+
- POSTGRES_USER=${POSTGRES_USER}
40+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
41+
- POSTGRES_DB=${POSTGRES_DB}
4242
volumes:
4343
- data:/var/lib/postgresql/data
4444
ports:

0 commit comments

Comments
 (0)