forked from teknologi-umum/hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
137 lines (135 loc) · 6.66 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
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
130
131
132
133
134
135
136
137
x-defaults:
&defaults
ENVIRONMENT: production
services:
frontend:
build: ./frontend
environment:
<<: [ *defaults ]
PORT: 3000
VITE_API_BASE_URL: http://backend:9090
VITE_BROWSER_API_BASE_URL: https://hacktoberfest.teknologiumum.com
labels:
- "traefik.enable=true"
- "traefik.http.routers.hacktoberfest_frontend.entrypoints=web,websecure"
- "traefik.http.routers.hacktoberfest_frontend.rule=Host(`hacktoberfest.teknologiumum.com`) && PathPrefix(`/`)"
- "traefik.http.routers.hacktoberfest_frontend.priority=1"
- "traefik.http.routers.hacktoberfest_frontend.tls.certresolver=tlsresolver"
- "traefik.http.routers.hacktoberfest_frontend.middlewares=hacktoberfest_frontend-error,hacktoberfest_frontend-header,hacktoberfest_frontend-rate,hacktoberfest_frontend-redirectscheme,hacktoberfest_frontend-compress"
- "traefik.http.services.hacktoberfest_frontend.loadbalancer.server.port=3000"
- "traefik.http.services.hacktoberfest_frontend.loadbalancer.server.scheme=http"
- "traefik.http.services.hacktoberfest_frontend.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.hacktoberfest_frontend.loadbalancer.healthcheck.path=/"
- "traefik.http.middlewares.hacktoberfest_frontend-compress.compress=true"
- "traefik.http.middlewares.hacktoberfest_frontend-compress.compress.minresponsebodybytes=128"
- "traefik.http.middlewares.hacktoberfest_frontend-error.errors.status=500-599"
- "traefik.http.middlewares.hacktoberfest_frontend-error.errors.service=hacktoberfest_frontend@docker"
- "traefik.http.middlewares.hacktoberfest_frontend-error.errors.query=/error"
- "traefik.http.middlewares.hacktoberfest_frontend-rate.ratelimit.average=200"
- "traefik.http.middlewares.hacktoberfest_frontend-rate.ratelimit.burst=100"
- "traefik.http.middlewares.hacktoberfest_frontend-rate.ratelimit.period=1s"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.addvaryheader=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.frameDeny=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.hacktoberfest_frontend-header.headers.customResponseHeaders.server=Teknologi Umum"
- "traefik.http.middlewares.hacktoberfest_frontend-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.hacktoberfest_frontend-redirectscheme.redirectscheme.permanent=true"
platform: linux/amd64
healthcheck:
test: curl -f http://localhost:3000/ || exit 1
interval: 15s
timeout: 10s
retries: 5
deploy:
mode: replicated
replicas: 3
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 10
window: 120s
resources:
limits:
memory: 500MB
cpus: '0.75'
reservations:
memory: 100MB
cpus: '0.10'
networks:
- hacktoberfest
logging:
driver: json-file
options:
max-size: 100M
max-file: 3
backend:
build: ./backend
environment:
<<: [ *defaults ]
LISTEN_ADDR: 0.0.0.0:9090
NUM_WORKERS: 1
SCRAP_INTERVAL: 3600
GITHUB_TOKEN: ${GITHUB_TOKEN}
labels:
- "traefik.enable=true"
- "traefik.http.routers.hacktoberfest_backend.entrypoints=web,websecure"
- "traefik.http.routers.hacktoberfest_backend.rule=Host(`hacktoberfest.teknologiumum.com`) && (Path(`/repo`) || Path(`/contrib`))"
- "traefik.http.routers.hacktoberfest_backend.priority=2"
- "traefik.http.routers.hacktoberfest_backend.tls.certresolver=tlsresolver"
- "traefik.http.routers.hacktoberfest_backend.middlewares=hacktoberfest_backend-error,hacktoberfest_backend-header,hacktoberfest_backend-rate,hacktoberfest_backend-redirectscheme"
- "traefik.http.services.hacktoberfest_backend.loadbalancer.server.port=9090"
- "traefik.http.services.hacktoberfest_backend.loadbalancer.server.scheme=http"
- "traefik.http.services.hacktoberfest_backend.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.hacktoberfest_backend.loadbalancer.healthcheck.path=/healthz"
- "traefik.http.middlewares.hacktoberfest_backend-error.errors.status=500-599"
- "traefik.http.middlewares.hacktoberfest_backend-error.errors.service=hacktoberfest_frontend@docker"
- "traefik.http.middlewares.hacktoberfest_backend-error.errors.query=/error"
- "traefik.http.middlewares.hacktoberfest_backend-rate.ratelimit.average=200"
- "traefik.http.middlewares.hacktoberfest_backend-rate.ratelimit.burst=100"
- "traefik.http.middlewares.hacktoberfest_backend-rate.ratelimit.period=1s"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.addvaryheader=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.frameDeny=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.browserxssfilter=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.stsSeconds=604800"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.contentTypeNosniff=true"
- "traefik.http.middlewares.hacktoberfest_backend-header.headers.customResponseHeaders.server=Teknologi Umum"
- "traefik.http.middlewares.hacktoberfest_backend-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.hacktoberfest_backend-redirectscheme.redirectscheme.permanent=true"
platform: linux/amd64
healthcheck:
test: curl -f http://localhost:9090/healthz || exit 1
interval: 15s
timeout: 10s
retries: 5
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 10
window: 120s
resources:
limits:
memory: 1GB
cpus: '3'
reservations:
memory: 500MB
cpus: '0.10'
networks:
- hacktoberfest
logging:
driver: json-file
options:
max-size: 100M
max-file: 3
networks:
hacktoberfest:
driver: bridge
external: true