Last active
January 14, 2022 10:25
-
-
Save bocharsky-bw/3ef82076f022ba11fad9 to your computer and use it in GitHub Desktop.
The full-stack [Ubuntu, Nginx, php-fpm] Docker image example
This file contains 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
web: | |
build: . | |
ports: | |
- "88:80" | |
volumes: | |
- ./:/var/www/symfony/ |
This file contains 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 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 |
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
---> 9e422fbfb4f3
Step 4/12 : RUN apt-get install -y nginx php5 php5-fpm php5-intl php5-mysql php5-xdebug
---> Running in 8c44d42fe755
Reading package lists...
Building dependency tree...
Reading state information...
Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-fpm is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php5' has no installation candidate
E: Package 'php5-fpm' has no installation candidate
E: Unable to locate package php5-intl
E: Package 'php5-mysql' has no installation candidate
E: Unable to locate package php5-xdebug
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get install -y nginx php5 php5-fpm php5-intl php5-mysql php5-xdebug' returned a non-zero code: 100