-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
111 lines (103 loc) · 3.41 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
101
102
103
104
105
106
107
108
109
110
111
# https://medium.com/trabe/map-subdomains-to-docker-containers-with-traefik-efd6aa66e073
version: "3"
services:
gettem:
restart: always
image: otacon900/gettem:latest
environment:
REACT_APP_STRAPI_URL: ${STRAPI_URL}
REACT_APP_STRAPI_AUTH_TOKEN: ${STRAPI_AUTH_TOKEN}
deploy:
resources:
limits:
cpus: '0.1' # Maximum number of CPUs (can be fractional)
memory: 20M # Maximum memory (M for Megabytes, G for Gigabytes)
reservations:
cpus: '0.1' # Maximum number of CPUs (can be fractional)
memory: 20M # Maximum memory (M for Megabytes, G for Gigabytes)
container_name: "gettem"
ports:
- "3000:3000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.gettem.rule=Host(`joneid.dev`)"
- "traefik.http.routers.gettem.entrypoints=websecure"
- "traefik.http.services.gettem.loadbalancer.server.port=3000"
- "traefik.http.routers.gettem.tls.certresolver=myresolver"
strapi:
build:
context: ./backend
dockerfile: Dockerfile.prod
container_name: "strapi"
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: gettem
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USERNAME: ${DB_USER}
DATABASE_PASSWORD: ${DB_PASS}
APP_KEYS: ${APP_KEYS}
API_TOKEN_SALT: ${API_TOKEN_SALT}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
JWT_SECRET: ${JWT_SECRET}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
URL: ${STRAPI_URL}
volumes:
- ./backend:/app
ports:
- "1337:1337"
depends_on:
- postgres
labels:
- "traefik.enable=true"
- "traefik.http.routers.strapi.rule=Host(`dashboard.joneid.dev`)"
- "traefik.http.routers.strapi.entrypoints=websecure"
- "traefik.http.services.strapi.loadbalancer.server.port=1337"
- "traefik.http.routers.strapi.tls.certresolver=myresolver"
cache_keeper:
restart: always
build:
context: ./cache_keeper
dockerfile: Dockerfile.prod
container_name: "cache_keeper"
environment:
STRAPI_URL: ${STRAPI_URL}
STRAPI_AUTH_TOKEN: ${STRAPI_AUTH_TOKEN}
depends_on:
- strapi
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: gettem
volumes:
- ./pgdata:/var/lib/postgresql/data
traefik:
image: "traefik:v2.10"
deploy:
resources:
limits:
cpus: '0.2' # Maximum number of CPUs (can be fractional)
memory: 50M # Maximum memory (M for Megabytes, G for Gigabytes)
reservations:
cpus: '0.2' # Maximum number of CPUs (can be fractional)
memory: 50M # Maximum memory (M for Megabytes, G for Gigabytes)
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=jonathaneid98@gmail.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"