Skip to content

Commit

Permalink
Use php8 for docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
phavekes committed Dec 19, 2024
1 parent c118697 commit b404242
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
19 changes: 7 additions & 12 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2:latest
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest AS php-build
ARG APP_VERSION
ARG GIT_SHA
ARG GIT_COMMIT_TIME
ENV OPENCONEXT_APP_VERSION=${APP_VERSION}
ENV OPENCONEXT_GIT_SHA=${GIT_SHA}
ENV OPENCONEXT_COMMIT_DATE=${GIT_COMMIT_TIME}

COPY *.tar.bz2 /tmp/
RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \
rm -rf /tmp/*.tar.bz2

WORKDIR /var/www/html
# Add the application configuration files
COPY config/legacy/parameters.yaml.dist config/legacy/parameters.yaml
COPY config/packages/prod/monolog.yaml.docker config/packages/prod/monolog.yaml
RUN cp config/openconext/parameters.yaml.dist config/openconext/parameters.yaml

# Add the config files for Apache2
RUN rm -rf /etc/apache2/sites-enabled/*
COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf

# Recreate the cache directory and set the correct permissions
RUN rm -rf /var/www/html/var/cache/prod && \
mkdir -p /var/www/html/var/cache/prod && \
chown -R www-data /var/www/html/var

RUN rm -rf /var/www/html/var/cache/prod && chown -R www-data /var/www/html/var
EXPOSE 80

CMD ["apache2-foreground"]
# Set the default workdir
WORKDIR /var/www/html

CMD ["apache2-foreground"]
16 changes: 7 additions & 9 deletions docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest
WORKDIR /var/www/html
COPY --from=unpack /unpack/ /var/www/html/
# Add the application configuration files
COPY config/openconext/parameters.yaml.dist config/openconext/parameters.yaml

# Add the config files for Apache2
RUN rm -rf /etc/apache2/sites-enabled/*
COPY ./docker/conf/middleware-test-apache2.conf /etc/apache2/sites-enabled/middleware.conf
RUN rm -rf /var/www/html/var/cache/prod &&\
mkdir -p /var/www/html/var/cache &&\
RUN cp config/openconext/parameters.yaml.dist config/openconext/parameters.yaml && \
rm -rf /etc/apache2/sites-enabled/*
COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf
RUN rm -rf /var/www/html/var/cache/prod && \
mkdir -p /var/www/html/var/ && \
chown -R www-data /var/www/html/var

EXPOSE 80
CMD ["apache2-foreground"]

CMD ["apache2-foreground"]

0 comments on commit b404242

Please sign in to comment.