-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.base.yaml
86 lines (82 loc) · 2.85 KB
/
compose.base.yaml
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
services:
frontend:
container_name: frontend
restart: unless-stopped
image: frontend
build:
context: frontend
depends_on:
- backend
environment:
# refer to configuration.ts and _app.tsx to see used vars
NEXT_PUBLIC_API_HOST: ${FRONTEND_API}
NEXT_PUBLIC_OAUTH_AUTHORITY: ${OAUTH_AUTHORITY}
NEXT_PUBLIC_OIDC_REDIRECT_HOST: ${FRONTEND_REDIRECT_HOST}
NEXT_PUBLIC_OIDC_CLIENT_ID: ${FRONTEND_OIDC_CLIENT_ID}
NEXT_PUBLIC_TEMPLATE_REPOSITORY: ${REPOSITORY_URL}
NEXT_PUBLIC_FORCED_TAGS: ${FRONTEND_PLATFORM_TAGS}
NEXT_PUBLIC_REPOSITORY_URL: ${REPOSITORY_URL}
NEXT_PUBLIC_ISSUES_URL: ${ISSUES_URL}
labels:
traefik.http.routers.webapp.rule: Host(`${DOMAIN}`)
backend:
image: backend
depends_on:
database:
condition: service_healthy
#smtp_server:
# condition: service_healthy
build:
context: backend
dockerfile: dockerfile
args:
GIT_USERNAME: ${PROJECT_NAME?Undefined PROJECT_NAME for git config}
GIT_EMAIL: ${BACKEND_GIT_EMAIL?Undefined BACKEND_GIT_EMAIL for git config}
environment:
PROJECT_NAME: ${PROJECT_NAME}
REPOSITORY_URL: ${REPOSITORY_URL}
#CORS_ORIGINS: ${CORS_ORIGINS}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
TRUSTED_OP: "[\"${OAUTH_AUTHORITY}\"]"
ADMIN_SECRET: ${ADMIN_SECRET}
labels:
traefik.http.routers.backend.rule: Host(`${DOMAIN}`) && PathPrefix(`/api/latest`)
traefik.http.middlewares.cors.headers.accesscontrolallowmethods: "GET,OPTIONS,PUT,POST,PATCH,DELETE"
traefik.http.middlewares.cors.headers.accesscontrolallowheaders: "*"
traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist: ${CORS_ORIGINS}
traefik.http.middlewares.cors.headers.accesscontrolmaxage: "100"
traefik.http.middlewares.cors.headers.addvaryheader: "true"
traefik.http.routers.backend.middlewares: cors
database:
image: postgres:15
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-some_password}
POSTGRES_USER: ${POSTGRES_USER:-db_user}
POSTGRES_DB: ${POSTGRES_DB:-db_name}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
interval: 1s
timeout: 5s
retries: 10
#smtp_server:
# image: boky/postfix:v3.6.1-alpine
# environment:
# ALLOWED_SENDER_DOMAINS: templates.cloud.ai4eosc.eu
reverse-proxy:
container_name: traefik
restart: unless-stopped
image: traefik:v2.10
command:
- "--entrypoints.web.address=:80"
- "--providers.docker"
depends_on:
- backend
- frontend
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock