-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
66 lines (62 loc) · 1.55 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
services:
frontend:
build: ./frontend
depends_on:
- backend
restart: unless-stopped
container_name: jw-frontend
hostname: frontend
environment:
- NODE_ENV=production
- BACKEND=http://backend
- NEXT_PUBLIC_BACKEND_API=/api
- NEXT_PUBLIC_SITE_URL=https://jorianwoltjer.com
- CLOUDFLARE_ZONE_ID=${CLOUDFLARE_ZONE_ID}
- CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
- PORT=80
- INTERNAL_TOKEN=${INTERNAL_TOKEN}
networks:
- website
backend:
build: ./backend
depends_on:
- db
restart: unless-stopped
container_name: jw-backend
hostname: backend
environment:
- DATABASE_URL=postgresql://backend:${BACKEND_PASSWORD}@db/postgres
- FRONTEND=http://frontend
- PRODUCTION=true
- PORT=80
- INTERNAL_TOKEN=${INTERNAL_TOKEN}
networks:
- website
db:
image: postgres:latest
container_name: jw-db
hostname: db
restart: unless-stopped
environment:
- BACKEND_PASSWORD=${BACKEND_PASSWORD}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- website
volumes:
- postgres-data:/var/lib/postgresql/data
- ./config/postgres-init.sh:/docker-entrypoint-initdb.d/init.sh
nginx:
image: nginx:latest
restart: unless-stopped
container_name: jw-nginx
networks:
- website
ports:
- ${HOST}:${PORT}:80
volumes:
- ./config/nginx-default.conf:/etc/nginx/conf.d/default.conf
- ./img:/usr/share/nginx/html/img
networks:
website:
volumes:
postgres-data: