-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·83 lines (81 loc) · 2.3 KB
/
docker-compose.yml
File metadata and controls
executable file
·83 lines (81 loc) · 2.3 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
# Local development setup with FrankenPHP
services:
# Database service
postgres:
image: postgres:16-alpine
container_name: gsa_db
restart: always
ports:
- "5432:5432" # Expose PostgreSQL to host
environment:
POSTGRES_PASSWORD: My47P^e2KqD*z%
POSTGRES_DB: gsa_db
POSTGRES_USER: postgres
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ./postgresql.conf:/etc/postgresql/postgresql.conf # Custom configuration
- ./init.sql:/docker-entrypoint-initdb.d/01-init.sql
networks:
- gsa_network
# Resource limits - increased for better connection handling
ulimits:
nofile:
soft: 65536
hard: 65536
deploy:
resources:
limits:
memory: 512M # Reasonable limit for PostgreSQL
cpus: '1.0'
reservations:
memory: 256M # Minimum memory reservation
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5 # Increased retries for stability
start_period: 60s
# FrankenPHP service (replaces nginx + php-fpm)
frankenphp:
build:
context: .
dockerfile: Dockerfile.frankenphp
container_name: gsa_frankenphp
restart: always
ports:
- "8080:80" # Your computer port 8080 → Container port 80
volumes:
- ./app:/app
- ./storage:/app/storage
- ./Caddyfile:/app/Caddyfile
- ./php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
- ./init.sql:/app/init.sql:ro
depends_on:
postgres:
condition: service_healthy
networks:
- gsa_network
environment:
# Timezone
- TZ=Europe/Berlin
# Database connection settings
- DB_HOST=postgres
- DB_NAME=gsa_db
- DB_USER=postgres
- DB_PASS=My47P^e2KqD*z%
- DB_PORT=5432
# API configuration
- API_LOGGING_ACTIVE=true
- API_MAX_RESULTS=1777
# Run schema check before starting FrankenPHP
command: sh -c "php /app/check_schema.php && exec frankenphp run --config /app/Caddyfile"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
gsa_network:
driver: bridge