-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
71 lines (67 loc) · 1.9 KB
/
docker-compose.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
services:
app:
container_name: bem-server
restart: always
build:
context: .
dockerfile: Dockerfile
environment:
DB_CONNECTION: '${DB_CONNECTION}'
DB_HOST: '${DB_CONTEINER_NAME:-pgsql}'
DB_PORT: '${DB_PORT}'
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
ports:
- '${APP_PORT:-9000}:9000'
working_dir: /var/www
volumes:
- '.:/var/www'
networks:
- backend
command: /bin/sh -c "chmod -R 777 storage bootstrap/cache && composer i && php artisan migrate && php artisan app:register-fungi-occurrences && php-fpm"
depends_on:
pgsql:
condition: service_healthy
webserver:
image: nginx:alpine
container_name: nginx-bem-server
ports:
- "80:80"
volumes:
- .:/var/www
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
networks:
- backend
depends_on:
- app
pgsql:
image: 'postgres:15'
restart: always
container_name: '${DB_CONTEINER_NAME:-pgsql}'
ports:
- '${DB_PORT:-5432}:5432'
environment:
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- './pgdata:/var/lib/postgresql/data'
networks:
- backend
healthcheck:
test:
- CMD
- pg_isready
- '-q'
- '-d'
- '${DB_DATABASE}'
- '-U'
- '${DB_USERNAME}'
retries: 3
timeout: 5s
networks:
backend:
driver: bridge
volumes:
pgdata: