Files
merchbay/docker-compose.yml
2025-08-12 00:28:17 +08:00

74 lines
1.5 KiB
YAML
Executable File

services:
#PHP Service
app:
build:
context: .
dockerfile: Dockerfile
args:
- APP_ENV=production
image: digitalocean.com/php
container_name: app
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
environment:
APP_ENV: production
APP_DEBUG: 'false'
PHP_OPCACHE_VALIDATE_TIMESTAMPS: 0
working_dir: /var/www
volumes:
- ./storage:/var/www/storage
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- app-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/"]
interval: 30s
timeout: 3s
retries: 3
#Nginx Service
webserver:
image: nginx:alpine
container_name: webserver
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.30'
memory: 256M
reservations:
cpus: '0.10'
memory: 128M
ports:
- "10003:80"
- "10443:443"
volumes:
- ./public:/var/www/public
- ./nginx/conf.d/:/etc/nginx/conf.d/
networks:
- app-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 30s
timeout: 3s
retries: 3
depends_on:
app:
condition: service_healthy
#Docker Networks
networks:
app-network:
driver: bridge
#Volumes
volumes:
dbdata:
driver: local