-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
45 lines (44 loc) · 1.33 KB
/
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
version: "3.9"
services:
app-service:
image: redwallet212/app-service # specify name of image on Docker Hub
restart: "always" # automatically restart container when server crashes
container_name: app-service
environment: # set up environment variables
AUTH_SERVICE_IP: ${AUTH_SERVICE_IP}
ports:
- "8000:8000" # expose port 8000 so that applications outside the container can connect to it
depends_on: # only run app-service after auth-service has started
auth-service:
condition: service_started
auth-service:
image: redwallet212/auth-service
restart: always # automatically restart container when server crashes
container_name: auth-service
environment:
JWT_SECRET: ${JWT_SECRET}
DATABASE_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db:5432"
ports:
- "3000:3000" # expose port 3000 so that applications outside the container can connect to it
depends_on:
- db
- redis
db:
image: postgres:15.2-alpine
restart: always
container_name: db
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
redis:
image: redis:7.0-alpine
restart: always
container_name: redis
ports:
- "6379:6379"
volumes:
db_data:
driver: local