-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (46 loc) · 1.34 KB
/
docker-compose.yml
File metadata and controls
49 lines (46 loc) · 1.34 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
services:
app:
build: .
environment:
PORT: ${PORT:-8080}
ENV: ${ENV:-production}
DATABASE_URL: ${DATABASE_URL:-postgres://formify:formify@db:5432/formify?sslmode=disable}
JWT_SECRET: ${JWT_SECRET}
SESSION_SECRET: ${SESSION_SECRET}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
GOOGLE_CALLBACK_URL: ${GOOGLE_CALLBACK_URL:-http://localhost:8080/api/auth/google/callback}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:5173}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5173}
ports:
- "8080:8080"
depends_on:
migrate:
condition: service_completed_successfully
migrate:
build:
context: .
target: builder
command: ["go", "run", "./cmd/migrate", "-up"]
environment:
DATABASE_URL: ${DATABASE_URL:-postgres://formify:formify@db:5432/formify?sslmode=disable}
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: formify
POSTGRES_USER: formify
POSTGRES_PASSWORD: formify
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U formify"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: