-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
49 lines (48 loc) · 987 Bytes
/
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
48
49
version: '3'
services:
app:
container_name: blog-app
build: .
restart: on-failure
env_file:
- .env
environment:
- GO_ENV=${GO_ENV}
- PORT=${PORT}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_NAME=${DB_NAME}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- JWT_PUBLIC_KEY=${JWT_PUBLIC_KEY}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY}
ports:
- 8000:8080
volumes:
- api:/app
depends_on:
- postgres-db
networks:
- app_backend
postgres-db:
image: postgres:15-alpine
container_name: db_postgres
env_file:
- .env
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
- DB_HOST=${DB_HOST}
ports:
- ${DB_PORTS}:${DB_PORT}
volumes:
- database:/var/lib/postgresql/data
networks:
- app_backend
volumes:
api:
database:
networks:
app_backend:
driver: bridge