feat: add containerized deployment workflow
This commit is contained in:
+32
-12
@@ -1,33 +1,38 @@
|
||||
services:
|
||||
web:
|
||||
container_name: kanbangit-web
|
||||
image: kanbangit-app:local
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/nginx/Dockerfile
|
||||
dockerfile: Dockerfile
|
||||
target: runtime
|
||||
command: nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- kanbangit-storage:/var/www/storage:ro
|
||||
- kanbangit-public-assets:/var/www/public/build:ro
|
||||
- "8080:8080"
|
||||
env_file:
|
||||
- .env.production
|
||||
environment:
|
||||
PHP_FPM_UPSTREAM: php-fpm:9000
|
||||
networks:
|
||||
- kanbangit-web
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "--fail", "--silent", "http://127.0.0.1:8080/up"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
depends_on:
|
||||
php-fpm:
|
||||
condition: service_healthy
|
||||
|
||||
php-fpm:
|
||||
container_name: kanbangit-php-fpm
|
||||
image: kanbangit-app:local
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/php-fpm/Dockerfile
|
||||
target: production
|
||||
dockerfile: Dockerfile
|
||||
target: runtime
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- kanbangit-storage:/var/www/storage
|
||||
- kanbangit-public-assets:/var/www/public/build
|
||||
env_file:
|
||||
- .env.production
|
||||
networks:
|
||||
@@ -42,6 +47,23 @@ services:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
|
||||
worker:
|
||||
container_name: kanbangit-worker
|
||||
image: kanbangit-app:local
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: runtime
|
||||
command: php artisan queue:work --sleep=3 --tries=3 --timeout=60 --max-time=3600
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env.production
|
||||
networks:
|
||||
- kanbangit-db
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
|
||||
mariadb:
|
||||
container_name: kanbangit-db
|
||||
image: mariadb:11.4
|
||||
@@ -65,5 +87,3 @@ networks:
|
||||
|
||||
volumes:
|
||||
mariadb-data-production:
|
||||
kanbangit-storage:
|
||||
kanbangit-public-assets:
|
||||
|
||||
Reference in New Issue
Block a user