Skip to content

Commit

Permalink
Fix: optimization + ENV fix
Browse files Browse the repository at this point in the history
  • Loading branch information
curious-mike-dvc committed Jul 19, 2024
1 parent 32e1f18 commit 318d977
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ FROM php:8.1.22-fpm-alpine3.16 AS base
WORKDIR /var/www

# Musl for adding locales
ENV MUSL_LOCALE_DEPS cmake make musl-dev gcc gettext-dev libintl
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
ENV MUSL_LOCALE_DEPS="cmake make musl-dev gcc gettext-dev libintl"
ENV MUSL_LOCPATH="/usr/share/i18n/locales/musl"

RUN apk add --no-cache \
$MUSL_LOCALE_DEPS \
Expand Down Expand Up @@ -99,14 +99,13 @@ RUN docker-php-ext-configure \
COPY ./config/php.ini $PHP_INI_DIR/conf.d/

# Setup config for supervisor nginx php-fpm crontabs
RUN mkdir /etc/supervisor.d
RUN mkdir /etc/supervisor.d \
&& mkdir /var/log/supervisor/ \
&& touch /var/log/supervisor/supervisord.log \
&& chown -R www-data:www-data /var/log/supervisor/
COPY ./config/supervisord-master.ini /etc/supervisor.d/master.ini
COPY ./config/supervisord.conf /etc/

RUN mkdir /var/log/supervisor/
RUN touch /var/log/supervisor/supervisord.log
RUN chown -R www-data:www-data /var/log/supervisor/

COPY ./config/nginx-default.conf /etc/nginx/conf.d/default.conf
COPY ./config/nginx.conf /etc/nginx/nginx.conf

Expand All @@ -116,9 +115,11 @@ COPY ./config/php-fpm-docker.conf /usr/local/etc/php-fpm.d/docker.conf

RUN chmod 755 -R /etc/supervisor.d/ /etc/supervisord.conf /etc/nginx/ /etc/crontabs/

# Remove Build Dependencies
RUN apk del -f .build-deps
# Remove Build Dependencies and clean apk cache
RUN apk del -f .build-deps \
&& rm -rf /var/cache/apk/*

# Change nginx permissions
RUN mkdir -p /var/lib/nginx/tmp /var/log/nginx \
&& chown -R www-data:www-data /var/lib/nginx /var/log/nginx \
&& chmod -R 755 /var/lib/nginx /var/log/nginx
Expand Down

0 comments on commit 318d977

Please sign in to comment.