-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
47 lines (45 loc) · 1.06 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
41
42
43
44
45
46
47
version: '3.9'
services:
postgresdb:
image: postgres:latest
container_name: postgres_container
environment:
- POSTGRES_USER=${PG_USER}
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_DB=${PG_DATABASE}
- DATABASE_HOST=${PG_HOST}
ports:
- "5432:5432"
volumes:
- ./pg_data:/var/lib/postgresql/data
- ./sql/0_init.sql:/docker-entrypoint-initdb.d/0_init.sql
networks:
- learning
app:
container_name: golang_container
environment:
- PG_USER=${PG_USER}
- PG_PASSWORD=${PG_PASSWORD}
- PG_DATABASE=${PG_DATABASE}
- PG_HOST=${PG_HOST}
- PG_PORT=${PG_PORT}
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_MINI_APP_URL=${TELEGRAM_MINI_APP_URL}
tty: true
build: .
ports:
- "8080:8080"
restart: on-failure
volumes:
- .:/app
depends_on:
- postgresdb
networks:
- learning
volumes:
pg_data:
pg_data_test:
# Networks to be created to facilitate communication between containers
networks:
learning:
driver: bridge