FROM python:3.6 ENV PYTHONUNBUFFERED 1 ENV NGINX_VERSION="1.12.0" \ NGINX_OPTS="--with-http_ssl_module \ --with-http_gzip_static_module \ --prefix=/usr/share/nginx \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --pid-path=/var/run/nginx.pid \ --http-log-path=/var/log/nginx/access.log \ --error-log-path=/var/log/nginx/error.log \ --user=www-data \ --group=www-data \ --add-module=/tmp/modules/nginx_requestid-master" COPY requirements /opt/app/requirements RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get -y install ghostscript \ libfreetype6-dev \ python3-dev \ supervisor \ git-core \ make && \ # Install nodejs curl -sL https://deb.nodesource.com/setup_0.12 | bash - && \ apt-get install -y nodejs && \ apt-get clean && \ # Install bower npm cache clean && \ npm install -g bower && \ # Download additional nginx modules mkdir -p /tmp/modules && \ cd /tmp/modules && \ wget -O nginx-requestid.tar.gz https://github.com/hhru/nginx_requestid/archive/master.tar.gz && \ tar xvzf nginx-requestid.tar.gz && \ # Download and compile nginx cd /tmp && \ wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ tar xzvf nginx-${NGINX_VERSION}.tar.gz && \ cd nginx-${NGINX_VERSION} && \ ./configure ${NGINX_OPTS} && \ make && \ make install && \ pip install --upgrade pip && \ pip install --no-cache-dir -r /opt/app/requirements/production.txt && \ # Delete build dependencies after use cd /tmp \ && rm -rf \ modules \ nginx-${NGINX_VERSION} \ nginx-${NGINX_VERSION}.tar.gz \ /var/cache/apt/* \ /root/.cache \ /var/lib/apt/lists/* # for gitlab cli #COPY . /opt/app #VOLUME ["/opt/app/public/media"] WORKDIR /opt/app RUN rm -v /etc/nginx/nginx.conf ADD /conf/nginx.conf /etc/nginx/ EXPOSE 80 CMD ["conf/docker/entrypoint_stage.sh"]