docker
This commit is contained in:
65
docker-compose.yml
Normal file
65
docker-compose.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
# Docker stack for "Kehadiran Taklimat SPR" (Laravel 13 / PHP 8.4)
|
||||
#
|
||||
# Topology:
|
||||
# web (nginx) -> exposes 127.0.0.1:8080, host nginx reverse-proxies the
|
||||
# domain http://taklimatspr.apps.mbip.my to it.
|
||||
# app (fpm) -> PHP 8.4-FPM, runs migrations on boot.
|
||||
# queue -> database queue worker.
|
||||
# scheduler -> Laravel scheduler.
|
||||
#
|
||||
# Databases (sppm_taklimat + the existing sppm DB) live on the HOST MySQL and
|
||||
# are reached via host.docker.internal (see extra_hosts below + DOCKER.md).
|
||||
|
||||
x-app-build: &app-build
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
target: app
|
||||
|
||||
x-app-common: &app-common
|
||||
build: *app-build
|
||||
image: taklimatspr-app:latest
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env.docker
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
- app_storage:/var/www/html/storage
|
||||
|
||||
services:
|
||||
app:
|
||||
<<: *app-common
|
||||
environment:
|
||||
RUN_MIGRATIONS: "true"
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
target: web
|
||||
image: taklimatspr-web:latest
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- app
|
||||
ports:
|
||||
# Bind to loopback only; the host nginx terminates the public domain.
|
||||
- "127.0.0.1:8008:80"
|
||||
|
||||
queue:
|
||||
<<: *app-common
|
||||
environment:
|
||||
RUN_MIGRATIONS: "false"
|
||||
command: php artisan queue:work --sleep=3 --tries=3 --max-time=3600
|
||||
depends_on:
|
||||
- app
|
||||
|
||||
scheduler:
|
||||
<<: *app-common
|
||||
environment:
|
||||
RUN_MIGRATIONS: "false"
|
||||
command: php artisan schedule:work
|
||||
depends_on:
|
||||
- app
|
||||
|
||||
volumes:
|
||||
app_storage:
|
||||
Reference in New Issue
Block a user