mirror of
https://github.com/Snouzy/workout-cool.git
synced 2026-05-19 14:40:35 +00:00
Remove unnecessary values from docker compose. Make env file more parametrized. (#96)
This commit is contained in:
+6
-1
@@ -1,6 +1,11 @@
|
|||||||
# Database Configuration
|
# Database Configuration
|
||||||
|
POSTGRES_USER=my-user
|
||||||
|
POSTGRES_PASSWORD=my-password
|
||||||
|
POSTGRES_DB=workout-cool
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=5432
|
||||||
# Format: postgresql://USER:PASSWORD@HOST:PORT/DATABASE
|
# Format: postgresql://USER:PASSWORD@HOST:PORT/DATABASE
|
||||||
DATABASE_URL=postgresql://username:password@localhost:5432/workout_cool
|
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}
|
||||||
|
|
||||||
# Authentication
|
# Authentication
|
||||||
# The URL where your application is running
|
# The URL where your application is running
|
||||||
|
|||||||
+2
-5
@@ -3,17 +3,14 @@ services:
|
|||||||
image: postgres:15
|
image: postgres:15
|
||||||
ports:
|
ports:
|
||||||
- "${DB_PORT:-5432}:5432"
|
- "${DB_PORT:-5432}:5432"
|
||||||
environment:
|
|
||||||
POSTGRES_USER: username
|
|
||||||
POSTGRES_PASSWORD: password
|
|
||||||
POSTGRES_DB: workout_cool
|
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U username -d workout_cool"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
env_file: .env
|
||||||
|
|
||||||
workout_cool:
|
workout_cool:
|
||||||
build:
|
build:
|
||||||
|
|||||||
Reference in New Issue
Block a user