Skip to content

Commit

Permalink
Merge pull request #90 from shipping-docker/bionic
Browse files Browse the repository at this point in the history
Updating app container to Ubuntu 18.04.
  • Loading branch information
fideloper authored Jan 7, 2019
2 parents d7dcdb5 + 0b3f6b4 commit 00896f8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ As mentioned, anything not recognized as a built-in command will be used as an a

The aim of this project is simplicity. It includes:

* PHP 7.2
* PHP 7.3
* MySQL 5.7
* Redis ([latest](https://hub.docker.com/_/redis/))
* NodeJS ([latest](https://hub.docker.com/_/node/)), with Yarn & Gulp
Expand Down
44 changes: 19 additions & 25 deletions docker-files/docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

LABEL maintainer="Chris Fidao"

RUN useradd -ms /bin/bash -u 1337 vessel
WORKDIR /var/www/html

ENV GOSU_VERSION 1.7
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
&& apt-get purge -y --auto-remove ca-certificates wget

RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& echo "deb http://ppa.launchpad.net/nginx/development/ubuntu xenial main" > /etc/apt/sources.list.d/ppa_nginx_mainline.list \
&& apt-get update && apt-get install -y gnupg gosu \
&& gosu nobody true

RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& echo "deb http://ppa.launchpad.net/nginx/development/ubuntu bionic main" > /etc/apt/sources.list.d/ppa_nginx_mainline.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C \
&& apt-get update \
&& apt-get install -y curl zip unzip git supervisor sqlite3 \
&& apt-get install -y nginx php7.2-fpm php7.2-cli \
php7.2-pgsql php7.2-sqlite3 php7.2-gd \
php7.2-curl php7.2-memcached \
php7.2-imap php7.2-mysql php7.2-mbstring \
php7.2-xml php7.2-zip php7.2-bcmath php7.2-soap \
php7.2-intl php7.2-readline php7.2-xdebug \
php7.2-msgpack php7.2-igbinary \
&& apt-get install -y nginx php7.3-fpm php7.3-cli \
php7.3-pgsql php7.3-sqlite3 php7.3-gd \
php7.3-curl php7.3-memcached \
php7.3-imap php7.3-mysql php7.3-mbstring \
php7.3-xml php7.3-zip php7.3-bcmath php7.3-soap \
php7.3-intl php7.3-readline php7.3-xdebug \
php7.3-msgpack php7.3-igbinary php7.3-ldap \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& mkdir /run/php \
&& apt-get -y autoremove \
Expand All @@ -43,9 +37,9 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log \

COPY h5bp /etc/nginx/h5bp
COPY default /etc/nginx/sites-available/default
COPY php-fpm.conf /etc/php/7.2/fpm/php-fpm.conf
COPY xdebug.ini /etc/php/7.2/mods-available/xdebug.ini
COPY vessel.ini /etc/php/7.2/fpm/conf.d/99-vessel.ini
COPY php-fpm.conf /etc/php/7.3/fpm/php-fpm.conf
COPY xdebug.ini /etc/php/7.3/mods-available/xdebug.ini
COPY vessel.ini /etc/php/7.3/fpm/conf.d/99-vessel.ini

EXPOSE 80

Expand Down
2 changes: 1 addition & 1 deletion docker-files/docker/app/default
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ server {
location ~ \.php$ {
add_header X-Served-By Vessel;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

error_page 404 /index.php;
Expand Down
4 changes: 2 additions & 2 deletions docker-files/docker/app/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
; Pid file
; Note: the default prefix is /var
; Default Value: none
pid = /run/php/php7.2-fpm.pid
pid = /run/php/php7.3-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
Expand Down Expand Up @@ -122,7 +122,7 @@ daemonize = no
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
include=/etc/php/7.2/fpm/pool.d/*.conf
include=/etc/php/7.3/fpm/pool.d/*.conf

; Clear environment in FPM workers. Prevents arbitrary environment variables from
; reaching FPM worker processes by clearing the environment in workers before env
Expand Down
6 changes: 3 additions & 3 deletions docker-files/docker/app/start-container
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash

# Config /etc/php/7.2/mods-available/xdebug.ini
sed -i "s/xdebug\.remote_host\=.*/xdebug\.remote_host\=$XDEBUG_HOST/g" /etc/php/7.2/mods-available/xdebug.ini
# Config /etc/php/7.3/mods-available/xdebug.ini
sed -i "s/xdebug\.remote_host\=.*/xdebug\.remote_host\=$XDEBUG_HOST/g" /etc/php/7.3/mods-available/xdebug.ini

# Run PHP-FPM as current user
if [ ! -z "$WWWUSER" ]; then
sed -i "s/user\ \=.*/user\ \= $WWWUSER/g" /etc/php/7.2/fpm/pool.d/www.conf
sed -i "s/user\ \=.*/user\ \= $WWWUSER/g" /etc/php/7.3/fpm/pool.d/www.conf

# Set UID of user "vessel"
usermod -u $WWWUSER vessel
Expand Down
2 changes: 1 addition & 1 deletion docker-files/docker/app/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:php-fpm]
command=php-fpm7.2
command=php-fpm7.3
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 00896f8

Please sign in to comment.