This commit is contained in:
1 parent
125eab3cd4
commit
045d3a8fd3
8 files changed
+375
-65
No files matched your search
+39
-4
@@ -2,14 +2,14 @@ name: ${COMPOSE_PROJECT_NAME:-recruitment-hc}
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
build: &app-build
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
ports:
|
||||
- "${APP_BIND_IP:-127.0.0.1}:${APP_PORT:-8086}:80"
|
||||
environment:
|
||||
environment: &app-environment
|
||||
MYSQL_HOST: db
|
||||
MYSQL_PORT: "3306"
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-recruitment}
|
||||
@@ -18,8 +18,8 @@ services:
|
||||
REC_PASS_SCORE: ${REC_PASS_SCORE:-300}
|
||||
TZ: Asia/Jakarta
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- php_sessions:/var/lib/php/sessions
|
||||
healthcheck:
|
||||
@@ -62,6 +62,41 @@ services:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# One-shot services: never run the destructive dump as an app entrypoint.
|
||||
db-init:
|
||||
image: mysql:8.4
|
||||
restart: "no"
|
||||
entrypoint: ["sh", "/bootstrap/init-db.sh"]
|
||||
environment: *app-environment
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./docker/init-db.sh
|
||||
target: /bootstrap/init-db.sh
|
||||
read_only: true
|
||||
bind:
|
||||
create_host_path: false
|
||||
- type: bind
|
||||
source: ${DB_INIT_SQL_PATH:-./DB/recruitment_local_2026-10-14.sql}
|
||||
target: /bootstrap/initial.sql
|
||||
read_only: true
|
||||
bind:
|
||||
create_host_path: false
|
||||
|
||||
migrate:
|
||||
build: *app-build
|
||||
restart: "no"
|
||||
command: ["php", "/usr/local/share/recruitment/migrate.php"]
|
||||
environment: *app-environment
|
||||
depends_on:
|
||||
db-init:
|
||||
condition: service_completed_successfully
|
||||
# This service exits after migration; it is not an Apache server.
|
||||
healthcheck:
|
||||
disable: true
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin:5.2-apache
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in new issue
Block a user