-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (42 loc) · 1.07 KB
/
docker-compose.yml
File metadata and controls
44 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
services:
server:
build:
context: .
target: final
ports:
- 8080:8080
environment:
- SERVER_PORT=${SERVER_PORT:-8080}
- DB_HOST=db
- DB_PORT=${DB_PORT:-5432}
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-db-password}
- DB_NAME=${DB_NAME:-userorderapi}
- DB_SSLMODE=${DB_SSLMODE:-disable}
- JWT_SECRET=${JWT_SECRET:-your-secret-key}
- JWT_EXPIRATION=${JWT_EXPIRATION:-24h}
- GIN_MODE=${GIN_MODE:-debug}
- LOG_FILE=${LOG_FILE:-logs/app.log}
depends_on:
db:
condition: service_healthy
db:
image: postgres
restart: always
user: postgres
volumes:
- db-data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
environment:
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_DB=${DB_NAME:-userorderapi}
- POSTGRES_PASSWORD=${DB_PASSWORD:-db-password}
expose:
- 5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data: