-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
54 lines (48 loc) · 1005 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
50
51
52
53
54
# to run in development use this command
# `` sudo docker-compose -f docker-compose-dev.yml up --build ``
version: '3.8'
services:
postgres:
image: postgres:16.4-alpine
container_name: postgres
env_file:
- .env
ports:
- ${DATABASE_PORT}:5432
volumes:
- dbdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
networks:
- api-network
# Uncomment to use redis
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
restart: always
networks:
- api-network
api:
build:
context: .
dockerfile: ./Dockerfile
container_name: api
hostname: api
env_file:
- .env
ports:
- ${APP_PORT}:${APP_PORT}
restart: always
depends_on:
- postgres
networks:
- api-network
volumes:
dbdata:
networks:
api-network:
driver: bridge