Skip to content

Instantly share code, notes, and snippets.

@bocharsky-bw
Last active January 14, 2022 10:25
Show Gist options
  • Save bocharsky-bw/3ef82076f022ba11fad9 to your computer and use it in GitHub Desktop.
Save bocharsky-bw/3ef82076f022ba11fad9 to your computer and use it in GitHub Desktop.
The full-stack [Ubuntu, Nginx, php-fpm] Docker image example
web:
build: .
ports:
- "88:80"
volumes:
- ./:/var/www/symfony/
FROM ubuntu
MAINTAINER Victor Bocharsky <[email protected]>
RUN apt-get update
RUN apt-get install -y nginx php5 php5-fpm php5-intl php5-mysql php5-xdebug
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
RUN sed -i -e "s/;\?daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
# Nginx config
RUN rm /etc/nginx/sites-enabled/default
ADD ./docker/symfony.conf /etc/nginx/sites-available/
RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony.conf
# PHP config
RUN sed -i -e "s/;\?date.timezone\s*=\s*.*/date.timezone = Europe\/Kiev/g" /etc/php5/fpm/php.ini
# Define default command.
CMD service php5-fpm start && nginx
# Expose ports.
EXPOSE 80
@bocharsky-bw
Copy link
Author

Yeah, this is an old config... changing php5 to just php should work I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment