parent
c35ea47aec
commit
97c62b533b
6 changed files with 206 additions and 41 deletions
@ -0,0 +1,65 @@ |
|||||||
|
FROM python:3.6 |
||||||
|
ENV PYTHONUNBUFFERED 1 |
||||||
|
|
||||||
|
ENV NGINX_VERSION="1.13.2" \ |
||||||
|
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 && \ |
||||||
|
apt-get clean && \ |
||||||
|
|
||||||
|
# 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"] |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
version: '2' |
||||||
|
|
||||||
|
services: |
||||||
|
web: |
||||||
|
restart: always |
||||||
|
container_name: dokumentor-web |
||||||
|
build: . |
||||||
|
volumes: |
||||||
|
- ./:/opt/app |
||||||
|
ports: |
||||||
|
- "32768:80" |
||||||
|
- "33768:5555" |
||||||
|
env_file: conf/env |
||||||
|
depends_on: |
||||||
|
- db |
||||||
|
- redis |
||||||
|
- rabbitmq |
||||||
|
|
||||||
|
db: |
||||||
|
restart: always |
||||||
|
container_name: dokumentor-db |
||||||
|
image: kiasaki/alpine-postgres:9.5 |
||||||
|
expose: |
||||||
|
- "5432" |
||||||
|
volumes: |
||||||
|
- ./data/postgresql:/var/lib/postgresql/data |
||||||
|
environment: |
||||||
|
- POSTGRES_USER=dokumentor |
||||||
|
- POSTGRES_PASSWORD=dokumentor |
||||||
|
|
||||||
|
redis: |
||||||
|
restart: always |
||||||
|
container_name: dokumentor-redis |
||||||
|
image: redis:alpine |
||||||
|
expose: |
||||||
|
- "6379" |
||||||
|
|
||||||
|
rabbitmq: |
||||||
|
restart: always |
||||||
|
container_name: dokumentor-rabbitmq |
||||||
|
image: rabbitmq:alpine |
||||||
|
environment: |
||||||
|
- RABBITMQ_DEFAULT_USER=dokumentor |
||||||
|
- RABBITMQ_DEFAULT_PASS=dokumentor |
||||||
|
expose: |
||||||
|
- "5672" |
||||||
|
- "5671" |
||||||
|
|
||||||
|
bower: |
||||||
|
container_name: dokumentor-bower |
||||||
|
build: |
||||||
|
context: . |
||||||
|
dockerfile: ./conf/compose/Dockerfile |
||||||
|
command: /bin/sh -c "cd /opt/app && bower i" |
||||||
|
volumes: |
||||||
|
- ./:/opt/app |
||||||
Loading…
Reference in new issue