Skip to content

Commit

Permalink
Merge pull request #70 from jkaninda/develop
Browse files Browse the repository at this point in the history
Update php version, fix permission issue
  • Loading branch information
jkaninda authored Jan 6, 2024
2 parents 673a481 + 800c42b commit 34970e5
Show file tree
Hide file tree
Showing 18 changed files with 125 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/.history
laravel
laravel
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ services:
php-fpm:
image: jkaninda/laravel-php-fpm:latest
container_name: php-fpm
restart: unless-stopped
restart: unless-stopped
user: www-data #Use www-data user production usage
volumes:
#Project root
- ./:/var/www/html
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ then
docker build -f src/docker/${tag}/Dockerfile -t jkaninda/laravel-php-fpm:$tag .
else
echo 'Build latest'
docker build -f src/docker/8.2/Dockerfile -t jkaninda/laravel-php-fpm:$tag .
docker build -f src/docker/8.3/Dockerfile -t jkaninda/laravel-php-fpm:$tag .

fi

29 changes: 0 additions & 29 deletions docker-compose.yml

This file was deleted.

3 changes: 2 additions & 1 deletion example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ services:
php-fpm:
image: jkaninda/laravel-php-fpm
container_name: php-fpm
restart: unless-stopped
restart: unless-stopped
user: www-data #Use www-data user production usage
volumes:
#Project root
- ./:/var/www/html
Expand Down
18 changes: 11 additions & 7 deletions src/docker/7.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_VERSION=16.x
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -83,12 +87,12 @@ RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]



RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/
EXPOSE 9000
CMD [ "entrypoint" ]
16 changes: 10 additions & 6 deletions src/docker/7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_VERSION=16.x
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -83,12 +87,12 @@ RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/


RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
18 changes: 10 additions & 8 deletions src/docker/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_VERSION=16.x
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -86,12 +88,12 @@ RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/


RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
18 changes: 10 additions & 8 deletions src/docker/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_VERSION=16.x
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -86,12 +88,12 @@ RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/


RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
18 changes: 11 additions & 7 deletions src/docker/8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_VERSION=17.x
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -85,13 +87,15 @@ COPY src/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data
RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
6 changes: 4 additions & 2 deletions src/docker/8.1/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM php:8.1-fpm-alpine
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data

# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
Expand Down
18 changes: 10 additions & 8 deletions src/docker/8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_MAJOR=20
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -88,12 +90,12 @@ RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/


RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
6 changes: 4 additions & 2 deletions src/docker/8.2/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM php:8.2-fpm-alpine
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data

# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
Expand Down
21 changes: 12 additions & 9 deletions src/docker/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM php:8.3.0-fpm
FROM php:8.3.1-fpm
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV NODE_MAJOR=20
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -86,14 +88,15 @@ COPY src/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]


ENTRYPOINT ["entrypoint.sh"]

RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data
RUN usermod -u ${USER_ID} ${USER_NAME}
RUN groupmod -g ${USER_ID} ${GROUP_NAME}
RUN chown -R ${USER_NAME}:${GROUP_NAME} /var/www && \
chown -R ${USER_NAME}:${GROUP_NAME} /var/log/ && \
chown -R ${USER_NAME}:${GROUP_NAME} /etc/supervisor/conf.d/ && \
chown -R ${USER_NAME}:${GROUP_NAME} $PHP_INI_DIR/conf.d/

RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000
CMD [ "entrypoint" ]
6 changes: 4 additions & 2 deletions src/docker/8.3/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM php:8.3-fpm-alpine
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ARG HOST_UID=1000
ENV USER=www-data
ARG GROUP_ID=1000
ARG USER_ID=1000
ENV USER_NAME=www-data
ARG GROUP_NAME=www-data

# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
Expand Down
Loading

0 comments on commit 34970e5

Please sign in to comment.