Skip to content
Snippets Groups Projects
Dockerfile 1.23 KiB
Newer Older
  • Learn to ignore specific revisions
  • Renovate Bot's avatar
    Renovate Bot committed
    FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:23.1-alpine@sha256:db7d4c706c493243e556c19cf3b80556f8dc91d69fcb750b16909624bd5cbfa1 AS buildJS
    
    Jonas Leder's avatar
    Jonas Leder committed
    WORKDIR /app
    COPY . ./
    RUN yarn install --frozen-lockfile && \
        yarn build
    
    
    FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/composer:2.8.1@sha256:23b816d42eed0d55be359dcf8b6e5b8677bba0225cde423d91014b45e74c2d15 AS buildPHP
    
    Jonas Leder's avatar
    Jonas Leder committed
    WORKDIR /app
    COPY . ./
    RUN composer install --no-cache --no-interaction --prefer-dist --ignore-platform-reqs --optimize-autoloader
    
    
    FROM jonasled.dev/jonasled/nginx-php-minimal:82-3.18 as production
    
    Jonas Leder's avatar
    Jonas Leder committed
    COPY . .
    COPY --from=buildJS /app/public/build/ ./public/build/
    COPY --from=buildPHP /app/vendor/ ./vendor/
    COPY --from=buildPHP /app/public/ ./public/
    COPY ./vhost.conf /etc/nginx/http.d/default.conf
    
    Jonas Leder's avatar
    Jonas Leder committed
    RUN rm -rf ./var && \
        mkdir -p ./var/cache ./var/log && \
        chown nginx:nginx . -R && \
    
    Jonas Leder's avatar
    Jonas Leder committed
        apk add php${PHP_VERSION}-ctype php${PHP_VERSION}-dom php${PHP_VERSION}-tokenizer php${PHP_VERSION}-mbstring php${PHP_VERSION}-pdo php${PHP_VERSION}-pdo_mysql php${PHP_VERSION}-simplexml php${PHP_VERSION}-gd php${PHP_VERSION}-cli && \
        rm -rf /var/cache/apk/* && \
        sed -i "s|;clear_env = no|clear_env = no|g" /etc/php${PHP_VERSION}/php-fpm.d/www.conf