-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (69 loc) · 2.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (69 loc) · 2.55 KB
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
# Full stack: docker compose up -d --build db backend frontend
# Krever backend/.env. FRONTEND_URL der må matche nettleserens Origin (bruk http://localhost — ikke http://localhost:80, ellers feiler CORS).
# Valgfritt rot-.env for compose: FRONTEND_PORT=8080 hvis port 80 er opptatt. Åpne riktig URL: pwsh -File ./scripts/docker-frontend-rebuild.ps1
# E-post (Mailtrap): sett MAILTRAP_API_TOKEN. Turnstile i Docker: backend/.env.example.
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:8080}
VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:8080/ws}
# Samme site key som i RegisterView (ikke Cloudflare test-nøkkel — unngår «For testing only»).
VITE_TURNSTILE_SITE_KEY: ${VITE_TURNSTILE_SITE_KEY:-0x4AAAAAABSTiPNZwrBLQkgr}
VITE_POSTHOG_ENABLED: ${VITE_POSTHOG_ENABLED:-false}
VITE_POSTHOG_KEY: ${VITE_POSTHOG_KEY:-}
VITE_POSTHOG_HOST: ${VITE_POSTHOG_HOST:-}
ports:
- '${FRONTEND_PORT:-80}:80'
depends_on:
backend:
condition: service_started
profiles:
- ${PROFILE:-production}
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- '${BACKEND_PORT:-8080}:8080'
env_file:
- backend/.env
environment:
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE:-${SPRING_PROFILE:-dev}}
- SPRING_DATASOURCE_URL=jdbc:mysql://db:3306/krisefikser
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=root
- AUTH_ADMIN_TWO_FACTOR_ENABLED=${AUTH_ADMIN_TWO_FACTOR_ENABLED:-true}
depends_on:
db:
condition: service_healthy
profiles:
- ${PROFILE:-production}
db:
image: mysql:lts
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: krisefikser
ports:
- '3306:3306'
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test:
[
'CMD',
'mysqladmin',
'ping',
'-h',
'localhost',
'-u',
'root',
'-proot',
]
interval: 5s
timeout: 5s
retries: 5
volumes:
mysql_data: