-
Notifications
You must be signed in to change notification settings - Fork 328
/
Copy pathdocker-compose.dev.yml
107 lines (102 loc) · 2.89 KB
/
docker-compose.dev.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "3.8"
services:
api:
image: jhumanj/opnform-api:dev
container_name: opnform-api
build:
context: .
dockerfile: docker/Dockerfile.api
args:
APP_ENV: local
COMPOSER_FLAGS: ""
volumes:
- ./api:/usr/share/nginx/html:delegated
- /usr/share/nginx/html/vendor # Exclude vendor directory from the mount
- ./api/storage:/usr/share/nginx/html/storage:delegated
environment:
APP_ENV: local
APP_DEBUG: true
APP_DEV_CORS: true
# Database settings
DB_HOST: db
DB_DATABASE: ${DB_DATABASE:-forge}
DB_USERNAME: ${DB_USERNAME:-forge}
DB_PASSWORD: ${DB_PASSWORD:-forge}
DB_CONNECTION: ${DB_CONNECTION:-pgsql}
# Override production settings for minimal setup
CACHE_DRIVER: file
SESSION_DRIVER: file
QUEUE_CONNECTION: sync
# Storage settings
FILESYSTEM_DISK: local
LOCAL_FILESYSTEM_VISIBILITY: public
# Development settings
PHP_IDE_CONFIG: serverName=Docker
XDEBUG_MODE: ${XDEBUG_MODE:-off}
XDEBUG_CONFIG: client_host=host.docker.internal
APP_URL: http://localhost
FRONT_URL: http://localhost:3000
depends_on:
db:
condition: service_healthy
ui:
image: jhumanj/opnform-client:dev
container_name: opnform-client
build:
context: .
dockerfile: docker/Dockerfile.client
command: sh -c "npm install && NITRO_HOST=0.0.0.0 NITRO_PORT=3000 npm run dev"
volumes:
- ./client:/app:delegated
- /app/node_modules # Keep container's node_modules
environment:
NODE_ENV: development
NUXT_PUBLIC_APP_ENV: development
HOST: "0.0.0.0"
PORT: 3000
# HMR settings
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
VITE_HMR_HOST: "localhost"
VITE_HMR_PORT: 24678
# API settings
NUXT_PUBLIC_APP_URL_BASE: "http://localhost"
NUXT_PUBLIC_API_BASE: "http://localhost/api"
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:3000" # Main dev server
- "24678:24678" # Vite HMR port
db:
image: postgres:16
container_name: opnform-db
environment:
POSTGRES_DB: ${DB_DATABASE:-forge}
POSTGRES_USER: ${DB_USERNAME:-forge}
POSTGRES_PASSWORD: ${DB_PASSWORD:-forge}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-forge}"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
ingress:
image: nginx:1
container_name: opnform-ingress
volumes:
- ./docker/nginx.dev.conf:/etc/nginx/templates/default.conf.template
environment:
NGINX_HOST: localhost
NGINX_PORT: 80
ports:
- "80:80"
depends_on:
api:
condition: service_started
ui:
condition: service_started
volumes:
postgres-data: