66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: ./docker/php
|
|
dockerfile: Dockerfile
|
|
container_name: frontend-app
|
|
restart: always
|
|
working_dir: /var/www
|
|
volumes:
|
|
- .:/var/www
|
|
|
|
command: >
|
|
/bin/sh -c 'mkdir -p /var/www/storage /var/www/bootstrap/cache &&
|
|
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache &&
|
|
chmod -R 775 /var/www/storage /var/www/bootstrap/cache &&
|
|
composer install --no-dev --optimize-autoloader &&
|
|
php-fpm'
|
|
healthcheck:
|
|
test: [ "CMD", "sh", "-c", "netstat -an | grep 9000 > /dev/null || exit 1" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 10
|
|
networks:
|
|
- frontend-network
|
|
- unioil-mobile-api_backend-network
|
|
environment:
|
|
- DB_HOST=db_mysql
|
|
- DB_PORT=3306
|
|
- DB_DATABASE=unioil-database
|
|
- DB_USERNAME=rootuser
|
|
- DB_PASSWORD=password
|
|
- MYSQL_ROOT_PASSWORD=newpassword
|
|
- CACHE_DRIVER=file
|
|
- API_URL=http://nginx:8081
|
|
|
|
web-frontend:
|
|
image: nginx:1.26.3-alpine
|
|
container_name: web-frontend
|
|
restart: always
|
|
ports:
|
|
- "8000:80"
|
|
expose:
|
|
- "80"
|
|
volumes:
|
|
- .:/var/www
|
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
app:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "-f", "http://localhost" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
networks:
|
|
- frontend-network
|
|
- unioil-mobile-api_backend-network
|
|
|
|
networks:
|
|
frontend-network:
|
|
driver: bridge
|
|
unioil-mobile-api_backend-network:
|
|
external: true
|