Last active
May 3, 2022 22:27
-
-
Save AreRex14/868319b0bfcc9049d08436ee3853b811 to your computer and use it in GitHub Desktop.
Build sample docker compose configuration based on Cyber-Duck/php-fpm-laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
build: | |
context: ./ | |
dockerfile: Dockerfile | |
args: | |
user: arif | |
uid: 10001 | |
image: example-app-cyberduck | |
volumes: | |
- .:/var/www | |
networks: | |
- example-app | |
nginx: | |
image: nginx:alpine | |
container_name: example-app-cyberduck-nginx | |
ports: | |
- 8082:80 | |
volumes: | |
- ./:/var/www | |
- ./docker-compose/nginx:/etc/nginx/conf.d/ | |
networks: | |
- example-app | |
networks: | |
example-app: | |
driver: bridge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM cyberduck/php-fpm-laravel:latest | |
# Arguments defined in docker-compose.yml | |
ARG user | |
ARG uid | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
curl \ | |
libpng-dev \ | |
libonig-dev \ | |
libxml2-dev \ | |
zip \ | |
unzip | |
# Clear cache | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | |
# Create system user to run Composer and Artisan Commands | |
RUN useradd -G www-data,root -u $uid -d /home/$user $user | |
RUN mkdir -p /home/$user/.composer && \ | |
chown -R $user:$user /home/$user | |
# Set working directory | |
WORKDIR /var/www | |
USER $user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment