-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
109 lines (109 loc) · 2.89 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
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
version: "3.8"
name: "nekosauce"
services:
backend:
build:
context: ./src/backend
args:
BUNNY_USERNAME: ${BACKEND_BUNNY_USERNAME}
BUNNY_PASSWORD: ${BACKEND_BUNNY_PASSWORD}
BUNNY_REGION: ${BACKEND_BUNNY_REGION}
BUNNY_HOSTNAME: ${BACKEND_BUNNY_HOSTNAME}
command: "/bin/sh -c \"/app/run.sh\""
depends_on:
- database
- redis
- rabbitmq
volumes:
- static:/static
secrets:
- BACKEND_SECRET_KEY
- DATABASE_PASSWORD
env_file:
- .env
restart: always
deploy:
resources:
limits:
memory: ${BACKEND_MEMORY_LIMIT}
reservations:
memory: ${BACKEND_MEMORY_RESERVATION}
frontend:
build:
context: ./src/frontend
args:
FRONTEND_FOOTER_DISCORD_LINK: ${FRONTEND_FOOTER_DISCORD_LINK}
FRONTEND_FOOTER_DONATE_LINK: ${FRONTEND_FOOTER_DONATE_LINK}
FRONTEND_FOOTER_TWITTER_LINK: ${FRONTEND_FOOTER_TWITTER_LINK}
FRONTEND_FOOTER_REDDIT_LINK: ${FRONTEND_FOOTER_REDDIT_LINK}
FRONTEND_FUNDING_PROGRESS: ${FRONTEND_FUNDING_PROGRESS}
FRONTEND_FUNDING_PROGRESS_FORMAT: ${FRONTEND_FUNDING_PROGRESS_FORMAT}
command: "npm run start"
restart: always
env_file:
- .env
database:
build: ./src/database
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/DATABASE_PASSWORD
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- database:/var/lib/postgresql/data
secrets:
- DATABASE_PASSWORD
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DATABASE_NAME}", "-U", "${DATABASE_USERNAME}"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
restart: always
redis:
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
restart: always
rabbitmq:
image: rabbitmq:alpine
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
restart: always
nginx:
image: nginx:1-alpine
depends_on:
- backend
- frontend
volumes:
- static:/static
- ./src/nginx/nekosauce.conf:/etc/nginx/conf.d/default.conf
- ./src/nginx/errors:/etc/nginx/errors
secrets:
- NGINX_CERT_CERTIFICATE
- NGINX_CERT_PRIVATE_KEY
ports:
- "443:443"
restart: always
secrets:
BACKEND_SECRET_KEY:
file: ./secrets/BACKEND_SECRET_KEY.txt
DATABASE_PASSWORD:
file: ./secrets/DATABASE_PASSWORD.txt
NGINX_CERT_CERTIFICATE:
file: ./secrets/NGINX_CERT_CERTIFICATE.pem
NGINX_CERT_PRIVATE_KEY:
file: ./secrets/NGINX_CERT_PRIVATE_KEY.pem
volumes:
database:
static: