Skip to content

Commit

Permalink
chore: Set docker-compose to use .env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
upa-r-upa committed Oct 31, 2024
1 parent ebe0d8c commit 6642892
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
JWT_SECRET_KEY=
TSK_DB_URL=
JWT_SECRET_KEY=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
TZ=
18 changes: 10 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
version: "3.8"

services:
taskie-backend:
image: taskie-backend
ports:
- "8000:8000"
environment:
JWT_SECRET_KEY: "secret_key"
TSK_DB_URL: "postgresql://testuser:testpass@postgres:5432/taskie_dev_db"
JWT_SECRET_KEY: "${JWT_SECRET_KEY}"
TSK_DB_URL: "${TSK_DB_URL}"
depends_on:
- postgres
restart: unless-stopped

postgres:
image: postgres:16
restart: always
Expand All @@ -18,10 +20,10 @@ services:
ports:
- "5432:5432"
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: taskie_dev_db
TZ: Asia/Seoul
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
TZ: "${TZ}"

volumes:
postgres_data:

0 comments on commit 6642892

Please sign in to comment.