-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
40 lines (37 loc) · 1.08 KB
/
docker-compose.yaml
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
version: "3.9"
services:
app:
container_name: golang_container
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- TZ=${TIMEZONE}
tty: true
build: .
ports:
- "8080:8080"
restart: on-failure
volumes:
- .:/app
depends_on:
- db
db:
image: postgres:15.1-alpine
container_name: postgres_container
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- DATABASE_HOST=${DATABASE_HOST}
- TZ=${TIMEZONE}
- PGTZ=${TIMEZONE}
ports:
- "5432:5432"
volumes:
- ./pg_data:/var/lib/postgresql/data
- ./schema/000001_init.up.sql:/docker-entrypoint-initdb.d/000001_init.up.sql
volumes:
pg_data: