-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
47 lines (45 loc) · 991 Bytes
/
docker-compose.yml
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
services:
backend:
build:
context: .
dockerfile: Dockerfile
container_name: server-app
depends_on:
- db
- redis
ports:
- "${PORT:-8000}:8000"
environment:
- DB_HOST=db
- REDIS_HOST=redis
- NODE_ENV=${NODE_ENV:-development}
env_file:
- .env
volumes:
- ./:/usr/src/app
- /usr/src/app/node_modules
db:
image: postgres:16
restart: always
container_name: postgres-db
env_file:
- .env
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- "5432:5432"
volumes:
- .dbdata:/var/lib/postgresql/data
redis:
image: redis:7
restart: always
container_name: redis-server
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
ports:
- "6379:6379"
volumes:
- .redisdata:/data