diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b505e0f..0000000 --- a/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM dunglas/frankenphp:php8.4 - -ENV SERVER_NAME=":80" -ENV CADDY_GLOBAL_OPTIONS="auto_https off" -ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime" -ENV APP_VERSION="0.0.1" - -RUN install-php-extensions \ - pdo_mysql \ - gd \ - intl \ - zip \ - opcache - -RUN apt update && apt install -y wget - -HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ] - -COPY --chmod=0755 docker/app/Caddyfile /etc/frankenphp/Caddyfile diff --git a/bash/build_base.sh b/bash/build_base.sh index 0088453..875a35f 100755 --- a/bash/build_base.sh +++ b/bash/build_base.sh @@ -1,7 +1,14 @@ -# torsearch-app is built from this base, and torsearch-worker & torsearch-scheduler are built from torsearch-app -# This image is used to speed up build times -export FRANKENPHP_TAG=php8.4 +# torsearch-app is built from this base +export APP_FRANKENPHP_TAG=php8.4 -docker buildx build --platform=linux/amd64 -f docker/Dockerfile.base -t code.caldwell.digital/home/torsearch-base:${FRANKENPHP_TAG} -t code.caldwell.digital/home/torsearch-base:latest --build-arg "FRANKENPHP_TAG=${FRANKENPHP_TAG}" . -docker push code.caldwell.digital/home/torsearch-base:${FRANKENPHP_TAG} +docker buildx build --platform=linux/amd64 -f docker/Dockerfile.base.app -t code.caldwell.digital/home/torsearch-base:${APP_FRANKENPHP_TAG} -t code.caldwell.digital/home/torsearch-base:latest --build-arg "FRANKENPHP_TAG=${APP_FRANKENPHP_TAG}" . +docker push code.caldwell.digital/home/torsearch-base:${APP_FRANKENPHP_TAG} docker push code.caldwell.digital/home/torsearch-base:latest + +# torsearch-worker & torsearch-scheduler are built from this base +export WORKER_FRANKENPHP_TAG=php8.4-alpine + +docker buildx build --platform=linux/amd64 -f docker/Dockerfile.base.worker -t code.caldwell.digital/home/torsearch-base-worker:${WORKER_FRANKENPHP_TAG} -t code.caldwell.digital/home/torsearch-base-worker:latest --build-arg "FRANKENPHP_TAG=${WORKER_FRANKENPHP_TAG}" . +docker push code.caldwell.digital/home/torsearch-base-worker:${WORKER_FRANKENPHP_TAG} +docker push code.caldwell.digital/home/torsearch-base-worker:latest + diff --git a/compose.yml b/compose.yml index 99366f6..b4fe8ad 100755 --- a/compose.yml +++ b/compose.yml @@ -15,7 +15,11 @@ services: app: - build: . + build: + dockerfile: docker/Dockerfile.base.app + context: . + args: + FRANKENPHP_TAG: php8.4 restart: unless-stopped volumes: - $PWD:/app @@ -33,7 +37,11 @@ services: worker: - build: . + build: + dockerfile: docker/Dockerfile.base.worker + context: . + args: + FRANKENPHP_TAG: php8.4-alpine restart: unless-stopped volumes: - $PWD:/app @@ -41,11 +49,15 @@ services: tty: true environment: TZ: America/Chicago - command: php /app/bin/console messenger:consume async -vv --time-limit=3600 + command: php /app/bin/console messenger:consume async --time-limit=3600 -vv scheduler: - build: . + build: + dockerfile: docker/Dockerfile.base.worker + context: . + args: + FRANKENPHP_TAG: php8.4-alpine restart: unless-stopped volumes: - $PWD:/app