-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
executable file
·100 lines (94 loc) · 2.21 KB
/
docker-compose.prod.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
version: '2.27'
services:
nginx:
image: nginx:latest
container_name: nginx_proxy
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/cache:/nginx/cache
restart: always
ports:
- "80:80"
- "443:443"
depends_on:
- api
- client
db:
image: postgres:latest
container_name: "postgres_db"
volumes:
- db_data:/var/lib/postgresql/data
- db_backups:/backups
restart: always
labels:
- "author=${AUTHOR}"
- "project=${SLUG}"
environment:
PGDATA: /var/lib/postgresql/data/pgdata/
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
api:
build:
context: ./server
dockerfile: Dockerfile.prod
args:
- ASPNETCORE_ENVIRONMENT=Production
container_name: "dotnet_api"
volumes:
- ./server/:/app
restart: always
labels:
- "author=${AUTHOR}"
- "project=${SLUG}"
ports:
- "8080:8080"
depends_on:
- db
environment:
BASE_URL: "${BASE_URL}"
DB_CONNECTION: "Host=db;Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD};Database=${POSTGRES_DB};"
client:
build:
context: ./client
dockerfile: Dockerfile.prod
args:
- NODE_ENV=production
- API_ADDRESS=${PROD_API_ADDRESS}
- INTERNAL_API_ADDRESS=${PROD_INTERNAL_API_ADDRESS}
container_name: "nuxt_client"
volumes:
- ./client/:/App
restart: always
labels:
- "author=${AUTHOR}"
- "project=${SLUG}"
ports:
- "3000:3000"
- "24678:24678"
- "4000:4000"
depends_on:
- api
backup:
image: alpine
container_name: "db_backup"
volumes:
- ./backup.sh/:/backup.sh
- db_backups:/backups
restart: always
labels:
- "author=${AUTHOR}"
- "project=${SLUG}"
entrypoint: "/bin/sh"
command: "-c 'echo \"0 2 * * * /bin/sh /backup.sh\" | crontab - && crond -f -d 8'"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
depends_on:
- db
volumes:
db_data:
db_backups: