-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
89 lines (89 loc) · 2.07 KB
/
docker-compose.yaml
File metadata and controls
89 lines (89 loc) · 2.07 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
services:
# Postgres
db:
image: postgres:17
container_name: devhub_db
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
#ports:
# - "${POSTGRES_PORT}"
networks:
- devhub_network
volumes:
- devhub_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 30s
timeout: 30s
retries: 3
start_period: 15s
restart: unless-stopped
# Laravel
backend:
#build:
# context: ./backend
# dockerfile: Dockerfile
image: fjrodafo/devhub-backend:latest
container_name: devhub_backend
depends_on:
db:
condition: service_healthy
#ports:
# - "${LARAVEL_PORT}"
networks:
- devhub_network
volumes:
- ./backend:/var/www
command: >
sh -c "composer install && php artisan key:generate && php artisan migrate --force && php artisan serve --host=0.0.0.0 --port=8000"
restart: unless-stopped
# React + Vite
frontend:
#build:
# context: ./frontend
# dockerfile: Dockerfile
image: fjrodafo/devhub-frontend:latest
container_name: devhub_frontend
depends_on:
- backend
#ports:
# - "${REACT_VITE_PORT}"
networks:
- devhub_network
volumes:
- ./frontend:/app
- /app/node_modules
working_dir: /app
command: >
sh -c "npm install && npm run dev -- --host"
restart: unless-stopped
# Nginx
nginx:
#build:
# context: ./nginx
# dockerfile: Dockerfile
image: fjrodafo/devhub-nginx:latest
container_name: devhub_nginx
depends_on:
- backend
- frontend
ports:
- "${NGINX_PORT}"
networks:
devhub_network:
aliases:
- devhub.com
- api.devhub.com
volumes:
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
restart: unless-stopped
# Networks
networks:
devhub_network:
name: devhub_network
# Volumes
volumes:
devhub_db_data:
name: devhub_db_data