Skip to content

Instantly share code, notes, and snippets.

@lovdianchel
Created August 4, 2020 00:56
Show Gist options
  • Save lovdianchel/e306b84437bfc12d7d33246d8b4cbfa6 to your computer and use it in GitHub Desktop.
Save lovdianchel/e306b84437bfc12d7d33246d8b4cbfa6 to your computer and use it in GitHub Desktop.
Supervisord Docker
version: '3'
networks:
laravel:
services:
mysql:
image: mysql:latest
container_name: mysql
ports:
- "3306:3306"
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: laravel-starter
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
networks:
- laravel
php:
image: lovdianchel/php-laravel:0.3-test
container_name: php
volumes:
- ./src:/var/www/html
ports:
- "9000:9000"
- "80:80"
networks:
- laravel
FROM php:7.4-fpm
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
nginx \
supervisor \
file \
re2c \
zip \
libmcrypt-dev \
libldb-dev \
libldap2-dev \
libzip-dev \
libgmp-dev \
libmhash-dev \
libmcrypt-dev \
zlib1g-dev \
libpng-dev \
libmagickwand-6.q16-dev --no-install-recommends \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& docker-php-ext-install \
gd \
ldap \
exif \
zip \
fileinfo \
gmp \
pdo pdo_mysql \
&& pecl install \
mcrypt \
imagick \
&& docker-php-ext-enable \
mcrypt \
imagick \
&& apt-get autoremove -y \
&& apt-get clean \
&& apt-get purge *-dev -y \
COPY config/nginx.conf /etc/nginx/conf.d/default.conf
COPY config/supervisor.conf /etc/supervisor/conf.d/supervisor.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
[program:php-fpm]
command=/usr/local/sbin/php-fpm
process_name=php-fpm
autostart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
process_name=nginx
autostart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment