-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
129 lines (121 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
129 lines (121 loc) · 2.67 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
version: "3.7"
services:
db_service:
image: postgres:13.3
hostname: postgres
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
ports:
- "5432:5432"
expose:
- 5432
networks:
- main_network
volumes:
- pgdata:/var/lib/postgresql/
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
redis_service:
image: redis:latest
restart: always
hostname: redis
ports:
- "6379:6379"
expose:
- 6379
networks:
- main_network
volumes:
- redisdata:/root/redis
- redisconf:/usr/local/etc/redis/redis.conf
environment:
REDIS_PASSWORD: ${REDIS_PASS}
REDIS_PORT: 6379
REDIS_DATABASES: 16
api_server:
build: backend
hostname: api
environment:
SERVER_ADDRESS: "0.0.0.0:8080"
SERVER_IP: "0.0.0.0"
SERVER_PORT: 8080
PG_NAME: ${DB_NAME}
PG_USER: ${DB_USER}
PG_PASS: ${DB_PASS}
PG_PORT: 5432
PG_HOST: ${DB_HOST}
USE_DB: "${USE_DB:-production}"
REDIS_PASSWORD: ${REDIS_PASS}
REDIS_PORT: 6379
REDIS_HOST: redis
VAPID_PUBLIC: ${VAPID_PUBLIC}
VAPID_PRIVATE: ${VAPID_PRIVATE}
DEBUG: false
SECRET_KEY: ${SECRET_KEY}
volumes:
# TODO: fix: PFPs disappear after restart
- media:/app/mediafiles/
ports:
- "8080:8080"
expose:
- 8080
networks:
- main_network
depends_on:
db_service:
condition: service_healthy
redis_service:
condition: service_started
links:
- db_service
- redis_service
frontend_service:
build: frontend
hostname: frontend
environment:
API_BASE_URL: "taskstorm.tapeline.dev/api/"
API_WS_URL: "wss://taskstorm.tapeline.dev/ws/"
ports:
- "3000:3000"
expose:
- 3000
networks:
- main_network
depends_on:
api_server:
condition: service_started
links:
- api_server
nginx_service:
command: nginx -g "daemon off;"
depends_on:
- api_server
- frontend_service
image: nginx:alpine
restart: on-failure
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- /home/server/sslcert/fullchain.pem:/etc/nginx/server.crt
- /home/server/sslcert/privkey.pem:/etc/nginx/server.key
ports:
- "80:80"
networks:
- main_network
links:
- api_server
- frontend_service
networks:
main_network:
driver: bridge
volumes:
pgdata:
redisdata:
redisconf:
media: