Add Docker and Nginx configuration for Cloud Run deployment
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
version: '3'
|
||||
services:
|
||||
|
||||
#PHP Service
|
||||
@@ -6,34 +5,64 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- APP_ENV=production
|
||||
image: digitalocean.com/php
|
||||
container_name: app
|
||||
restart: unless-stopped
|
||||
tty: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 256M
|
||||
environment:
|
||||
SERVICE_NAME: app
|
||||
SERVICE_TAGS: dev
|
||||
APP_ENV: production
|
||||
APP_DEBUG: 'false'
|
||||
PHP_OPCACHE_VALIDATE_TIMESTAMPS: 0
|
||||
working_dir: /var/www
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./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
|
||||
tty: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.30'
|
||||
memory: 256M
|
||||
reservations:
|
||||
cpus: '0.10'
|
||||
memory: 128M
|
||||
ports:
|
||||
- "10003:80"
|
||||
- "10443:443"
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./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:
|
||||
|
||||
Reference in New Issue
Block a user