Improve bouncer build

This commit is contained in:
Greyscale 2024-02-07 22:58:31 +01:00
parent bde8858ef9
commit 52aa04c59c
No known key found for this signature in database
GPG key ID: 74BAFF55434DA4B2
2 changed files with 3 additions and 7 deletions

View file

@ -95,8 +95,8 @@ jobs:
tags: |
${{ !env.ACT && 'benzine/bouncer:latest' || '' }}
${{ !env.ACT && 'ghcr.io/benzine-framework/bouncer:latest' || 'ghcr.io/benzine-framework/bouncer:devel' }}
cache-from: ${{ !env.ACT && 'type=gha' || 'type=local,src=/tmp' }}
cache-to: ${{ !env.ACT && 'type=gha,mode=max' || 'type=local,dest=/tmp' }}
cache-from: ${{ !env.ACT && 'type=gha' || '' }}
cache-to: ${{ !env.ACT && 'type=gha,mode=max' || '' }}
build-contexts: |
php:cli=docker-image://ghcr.io/benzine-framework/php:cli-8.2

View file

@ -6,8 +6,7 @@ LABEL maintainer="Matthew Baggett <matthew@baggett.me>" \
USER root
# ts:skip=AC_DOCKER_0002 Mis-detecting usage of apt instead of apt-get
# Install nginx, certbot
RUN adduser bouncer && \
apt-get -qq update && \
RUN apt-get -qq update && \
# Install pre-dependencies to use apt-key.
apt-get -yqq install --no-install-recommends \
lsb-core \
@ -81,9 +80,6 @@ EXPOSE 443
# Down-privelege to bouncer
USER bouncer
# Install Composer dependencies even though we don't need to, it should be done in the build process
RUN composer install
# Set a healthcheck to curl the bouncer and expect a 200
HEALTHCHECK --start-period=30s \
CMD curl -s -o /dev/null -w "200" http://localhost:80/ || exit 1