Answer the question
In order to leave comments, you need to log in
Docker-compose how to rebuild correctly?
subject... modifying something in docker files.. docker-compose down, .running docker-compose build (including --no-cache --force-rm)
swears that user already exists, or the extension is already installed (if it is installed from pecl, for example), you still have to sculpt the conditions with a check, but I'm not sure if this is normal
RUN groupadd -g 1000 dockery && \
useradd -u 1000 -g dockery -m dockery
as in the example https://docs.docker.com/engine/userguide/eng-image...Answer the question
In order to leave comments, you need to log in
There's a lot ....
That's the thing - it's not stably buggy, and sometimes it pierces, sometimes it doesn't
FROM php:7.0-fpm
ENV DEBIAN_FRONTEND noninteractive
#####################################
# Add configuration files
#####################################
COPY php7/files /
#####################################
# Non-Root User:
#####################################
ARG PUID=1000
ARG PGID=1000
RUN groupadd -r -g $PGID udocker && \
useradd -r -u $PUID -g udocker -m udocker
ENV PHP_USER_ID=33 \
HOME=/home/udocker \
PATH=/var/www/App:/var/www/App/vendor/bin:$HOME/.composer/vendor/bin:$PATH \
TERM=linux
#####################################
# Install system packages :
#####################################
RUN apt-get update && apt-get -y install \
git \
openssl\
libssh2-1-dev\
libssh2-php\
libssl-dev \
libxml2-dev \
libicu-dev \
libmcrypt-dev \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
zlib1g-dev \
mysql-client \
openssh-client \
libxml2-dev \
libpq-dev \
nano \
yui-compressor \
linkchecker \
librabbitmq-dev \
nodejs \
--no-install-recommends
#####################################
# Install PHP extensions :
#####################################
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
docker-php-ext-configure bcmath && \
docker-php-ext-install gd \
iconv\
intl \
pdo \
pdo_mysql \
pdo_pgsql \
mbstring \
mcrypt \
zip \
bcmath \
soap \
opcache
ENV RABBITMQ_C_VERSION 0.7.1
RUN curl -L -o /tmp/rabbitmq.tar.gz https://github.com/alanxz/rabbitmq-c/releases/download/v$RABBITMQ_C_VERSION/rabbitmq-c-$RABBITMQ_C_VERSION.tar.gz \
&& tar xfz /tmp/rabbitmq.tar.gz \
&& rm -r /tmp/rabbitmq.tar.gz \
&& cd rabbitmq-c-$RABBITMQ_C_VERSION \
&& ./configure \
&& make \
&& make install
#собссно тоже костыли
RUN if [ -z `php -m | grep -i "amqp"` ];then \
pecl install amqp && docker-php-ext-enable amqp \
;fi
RUN if [ -z `php -m | grep -i "redis"` ]; then \
pecl install redis && docker-php-ext-enable redis \
;fi
#####################################
# Composer:
#####################################
RUN curl -s http://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer
COPY php7/composer.json /home/udocker/.composer/composer.json
COPY php7/auth.json /home/udocker/.composer/auth.json
#ENV GITHUB_API_TOKEN ${GITHUB_API_TOKEN}
#RUN sed -i "s/GITHUB_API_TOKEN/$GITHUB_API_TOKEN/g" /home/udocker/.composer/auth.json
RUN chown -R udocker:udocker /home/udocker/.composer
USER udocker
RUN composer global install --prefer-dist && composer global dumpautoload --optimize
#####################################
# Node / NVM:
#####################################
USER root
# Check if NVM needs to be installed
ARG INSTALL_NODE=true
ENV INSTALL_NODE ${INSTALL_NODE}
RUN if [ ${INSTALL_NODE} = true ]; then \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash \
;fi
ENV if [ ${INSTALL_NODE} = true ]; then \
# Set the ENV
NVM_DIR=/home/udocker/.nvm \
# Install NodeJS with NVM
RUN . ~/.nvm/nvm.sh && \
nvm install stable && \
nvm use stable && \
nvm alias stable && \
npm install -g gulp bower \
;fi
# Wouldn't execute when added to the RUN statement in the above block
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
RUN if [ ${INSTALL_NODE} = true ]; then \
echo "" >> ~/.bashrc && \
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
#####################################
# CLEAN UP:
#####################################
USER root
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /var/www/App
CMD ["docker-run.sh"]
version: '2'
services:
app:
image: php:7.0-fpm
volumes:
- ./App:/var/www/App
command: "true"
restart: always
nginx:
build: ./dockerconf/nginx/
ports:
- 8001:80
links:
- php
volumes_from:
- app
php:
build:
dockerfile: php7/Dockerfile-fpm
context: 'dockerconf'
links:
- redis
- postgres
environment:
- GITHUB_API_TOKEN="${GITHUB_API_TOKEN}"
- INSTALL_NODE="${INSTALL_NODE}"
expose:
- 9000
volumes_from:
- app
volumes:
- ./dockerdata/logs/nginx:/var/log/nginx
redis:
image: redis:latest
ports:
- "6300:6379"
volumes:
- ./dockerdata/redis:/var/lib/redis
- ./dockerdata/logs/redis:/var/log/redis
restart: always
postgres:
build: ./dockerconf/postgres
volumes:
- ./dockerdata/pgsql:/var/lib/postgresql
- ./dockerdata/logs/pgsql:/var/log/postgresql
ports:
- "5400:5432"
environment:
- POSTGRES_DB=pgdb
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question