Skip to content

User #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

User #23

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile-apache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN printf "deb [arch=amd64] http://ppa.launchpad.net/ondrej/apache2/ubuntu bion
RUN a2enmod env headers proxy proxy_http proxy_fcgi rewrite

# Set proper permissions for Apache
RUN chown -R www-data:www-data \
RUN chown -R www:www \
/var/www &&\
rm -rf /var/www/html

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN printf "deb [arch=amd64] http://ppa.launchpad.net/ondrej/nginx/ubuntu bionic
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/{man,doc}

# Set proper permissions for Nginx
RUN chown -R www-data:www-data \
RUN chown -R www:www \
/var/lib/nginx \
/var/www &&\
install -d -m 0755 -o www-data -g www-data \
install -d -m 0755 -o www -g www \
/var/cache/nginx \
/var/run/nginx &&\
rm -rf /var/www/html
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile-php-cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ LABEL maintainer="Juan Treminio <jtreminio@gmail.com>"
ENV DEBIAN_FRONTEND=noninteractive
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn


# set container user
ARG WWWGID=1000
ARG WWWUID=1000
RUN groupadd --force -g $WWWGID www \
&& useradd -ms /bin/bash --no-user-group -g $WWWGID -u $WWWUID www


RUN update-alternatives --install /bin/sh sh /bin/bash 100

RUN mkdir /docker_build
Expand Down Expand Up @@ -32,12 +40,12 @@ RUN /docker_build/bin_install_composer.sh &&\
COPY files/php/php.ini /etc/php/php.ini

# Default sessions directory
RUN install -d -m 0755 -o www-data -g www-data /var/lib/php/sessions
RUN install -d -m 0755 -o www -g www /var/lib/php/sessions

# Xdebug CLI debugging
COPY files/php/xdebug /usr/bin/xdebug
RUN chmod +x /usr/bin/xdebug

WORKDIR /etc/php/${PHP_VER}

USER www-data
USER www
2 changes: 1 addition & 1 deletion Dockerfile-php-fpm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ COPY files/php/php-fpm /etc/service/fpm/run
RUN chmod +x /etc/service/fpm/run

# PID directory
RUN install -d -m 0755 -o www-data -g www-data /var/run/php-fpm
RUN install -d -m 0755 -o www -g www /var/run/php-fpm

EXPOSE 9000

Expand Down
2 changes: 1 addition & 1 deletion files/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /etc/nginx/nginx.conf

user www-data;
user www;

worker_processes auto;
pid /var/run/nginx/nginx.pid;
Expand Down
4 changes: 2 additions & 2 deletions files/php/bin_install_composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -x

# Installs Composer

install -d -m 0755 -o www-data -g www-data /.composer &&\
install -d -m 0755 -o www -g www /.composer &&\
curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/local/bin \
--filename=composer &&\
chown -R www-data:www-data /.composer
chown -R www:www /.composer
2 changes: 2 additions & 0 deletions files/php/bin_install_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ MODULES_OPTIONAL="
php${PHP_VER}-amqp
php${PHP_VER}-apcu
php${PHP_VER}-gd
php${PHP_VER}-gmp
php${PHP_VER}-igbinary
php${PHP_VER}-imagick
php${PHP_VER}-mailparse
php${PHP_VER}-memcached
php${PHP_VER}-mongodb
php${PHP_VER}-oauth
php${PHP_VER}-pcov
php${PHP_VER}-raphf
php${PHP_VER}-redis
php${PHP_VER}-soap
Expand Down
2 changes: 2 additions & 0 deletions files/php/bin_link_ini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ EXTRA_MODS=(
amqp
apcu
gd
gmp
imagick
mailparse
memcached
mongodb
oauth
pcov
pdo_sqlite
raphf
redis
Expand Down
2 changes: 2 additions & 0 deletions files/php/bin_rm_symlinked_ini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ function rm_symlinked_ini() {
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-apcu.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/25-apcu_bc.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-gd.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-gmp.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-geoip.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-gnupg.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-imagick.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/25-mailparse.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/25-memcached.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-mongodb.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-oauth.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-pcov.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-pdo_sqlite.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-radius.ini \
/etc/php/${PHP_VER}/${TYPE}/conf.d/20-raphf.ini \
Expand Down
2 changes: 1 addition & 1 deletion files/php/fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pid = ${FPM.pid}
error_log = /proc/self/fd/2

[www]
user = www-data
user = www
listen = ${FPM.listen}
; Redirect logs to stdout - FPM closes /dev/std* on startup
access.log = /proc/self/fd/2
Expand Down