-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (86 loc) · 2.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (86 loc) · 2.62 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
services:
nextdocs-api:
build:
context: ./api
dockerfile: Dockerfile
target: dev
ports:
- "8080:8080"
environment:
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-jdbc:postgresql://postgres:5432/nextdocs}
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME:-nextdocs}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-nextdocs}
# DDL is managed by Flyway; Hibernate only validates the schema
- SPRING_JPA_HIBERNATE_DDL_AUTO=validate
# JWT — must be overridden in production: openssl rand -base64 32
- JWT_SECRET=${JWT_SECRET:-CHANGE_ME_IN_PRODUCTION}
- JWT_ACCESS_EXPIRY_MS=${JWT_ACCESS_EXPIRY_MS:-900000}
- JWT_REFRESH_EXPIRY_MS=${JWT_REFRESH_EXPIRY_MS:-604800000}
# OAuth token encryption at rest (AES-GCM) — must be overridden in production
- OAUTH_TOKEN_ENCRYPTION_KEY_BASE64=${OAUTH_TOKEN_ENCRYPTION_KEY_BASE64:-CHANGE_ME_IN_PRODUCTION}
# CORS
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-http://localhost:3000}
# Set COOKIE_SECURE=true behind HTTPS in production
- COOKIE_SECURE=${COOKIE_SECURE:-false}
volumes:
- ./api:/app
- /app/target
- maven_data:/root/.m2
depends_on:
- postgres
networks:
- nextdocs-network
nextdocs-web:
build:
context: .
dockerfile: web/Dockerfile
target: builder
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8080
- NEXT_PUBLIC_REALTIME_URL=ws://localhost:1234
volumes:
- ./web:/app/web
- ./tsconfig.base.json:/app/tsconfig.base.json
- ./.prettierrc:/app/.prettierrc
- /app/web/node_modules
- /app/web/.next
command: npm run dev
networks:
- nextdocs-network
nextdocs-realtime:
build:
context: .
dockerfile: realtime/Dockerfile
target: builder
ports:
- "1234:1234"
environment:
- PORT=1234
- MAX_GLOBAL_CONNS=1000
volumes:
- ./realtime:/app/realtime
- ./tsconfig.base.json:/app/tsconfig.base.json
- ./.prettierrc:/app/.prettierrc
- /app/realtime/node_modules
- /app/realtime/dist
command: npm run dev
networks:
- nextdocs-network
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_DB=${POSTGRES_DB:-nextdocs}
- POSTGRES_USER=${POSTGRES_USER:-nextdocs}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-nextdocs}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- nextdocs-network
networks:
nextdocs-network:
driver: bridge
volumes:
postgres_data:
maven_data: