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
@danccas
Copy link

danccas commented Aug 2, 2020

---> 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

@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