Skip to content

Instantly share code, notes, and snippets.

@NdagiStanley
Last active April 2, 2022 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NdagiStanley/a540d350f58894902f1aeedda7146e8f to your computer and use it in GitHub Desktop.
Save NdagiStanley/a540d350f58894902f1aeedda7146e8f to your computer and use it in GitHub Desktop.
All the Things PHP

PHP

  • Laravel Dockerfile
FROM docker.io/bitnami/laravel:6-debian-10
# https://github.com/bitnami/bitnami-docker-laravel/blob/6.18.8-debian-10-r74/6/debian-10/Dockerfile
# Set working directory
WORKDIR /var/www
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy composer.lock and composer.json & composer install
COPY composer.lock composer.json /
RUN composer install
# Copy package.json package-lock.json & npm install
COPY package.json package-lock.json /
RUN npm install
# Copy existing application directory contents
COPY . /var/www
# Copy existing application directory permissions
COPY --chown=www:www . /var/www
# Change current user to www
USER www
CMD [ "sh", "server.sh" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment