WIP: Docker enhancement
* reduce containers into a single one, holding nginx + celery + redis all at once
This commit is contained in:
parent
460011a5e8
commit
aa02dbab96
@ -1,11 +1,11 @@
|
||||
FROM python:3.7-slim
|
||||
FROM python:3.7
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
WORKDIR /konova
|
||||
|
||||
# Install some dependencies
|
||||
RUN apt update
|
||||
RUN apt install -y gdal-bin
|
||||
RUN apt install -y gdal-bin redis-server nginx
|
||||
|
||||
# Copy requirements file into workspace
|
||||
COPY ./requirements.txt /konova/
|
||||
@ -13,6 +13,8 @@ RUN pip install --upgrade pip
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# Copy rest of project into workspace
|
||||
RUN rm /etc/nginx/sites-enabled/default
|
||||
COPY ./nginx/nginx.conf /etc/nginx/conf.d
|
||||
COPY . /konova/
|
||||
|
||||
# Move static files in designated folder
|
||||
|
@ -1,13 +1,13 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: redis
|
||||
container_name: "konova-redis-cache"
|
||||
volumes:
|
||||
- /redis/data:/bitnami/redis/data
|
||||
environment:
|
||||
- REDIS_PASSWORD=CHANGE_ME
|
||||
#redis:
|
||||
# image: redis
|
||||
# container_name: "konova-redis-cache"
|
||||
# volumes:
|
||||
# - /redis/data:/bitnami/redis/data
|
||||
# environment:
|
||||
# - REDIS_PASSWORD=CHANGE_ME
|
||||
|
||||
konova:
|
||||
external_links:
|
||||
@ -15,37 +15,37 @@ services:
|
||||
- arnova-nginx-server:arnova
|
||||
build: .
|
||||
container_name: "konova-docker"
|
||||
command: sh -c 'celery -A konova worker -l INFO --detach && gunicorn konova.wsgi:application --bind 0.0.0.0:8000'
|
||||
command: sh -c 'service nginx start && service redis-server start && celery -A konova worker --detach && gunicorn konova.wsgi:application --bind 0.0.0.0:8000'
|
||||
restart: always
|
||||
volumes:
|
||||
- .:/konova
|
||||
- /path/to/host/folder:/konova_uploaded_files
|
||||
- static_file_volume:/konova/static # Point to the volume for static files. Shared with nginx service
|
||||
expose:
|
||||
- 8000
|
||||
depends_on:
|
||||
- redis
|
||||
ports:
|
||||
- "1337:80"
|
||||
#depends_on:
|
||||
# - redis
|
||||
environment:
|
||||
- POSTGRES_NAME=konova
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_PASSWORD=CHANGE_ME
|
||||
- POSTGRES_USER=konova
|
||||
- POSTGRES_HOST=db
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_HOST=localhost
|
||||
- SSO_HOST=CHANGE_ME_TO_SSO_HOST_URL
|
||||
- SMTP_HOST=172.17.0.1
|
||||
- SMTP_PORT=25
|
||||
- SMTP_REAL_REPLY_MAIL=ksp-servicestelle@sgdnord.rlp.de
|
||||
|
||||
nginx:
|
||||
build: ./nginx
|
||||
container_name: "konova-nginx-server"
|
||||
ports:
|
||||
- "1337:80"
|
||||
depends_on:
|
||||
- konova
|
||||
volumes:
|
||||
- static_file_volume:/konova/static # Point to the volume for static files. Shared with konova service
|
||||
#nginx:
|
||||
# build: ./nginx
|
||||
# container_name: "konova-nginx-server"
|
||||
# ports:
|
||||
# - "1337:80"
|
||||
# depends_on:
|
||||
# - konova
|
||||
# volumes:
|
||||
# - static_file_volume:/konova/static # Point to the volume for static files. Shared with konova service
|
||||
|
||||
# Instead of an own, new network, we need to connect to the existing one, which is provided by the postgis container
|
||||
# NOTE: THIS NETWORK MUST EXIST
|
||||
|
@ -1,5 +1,5 @@
|
||||
upstream konova {
|
||||
server konova:8000;
|
||||
server localhost:8000;
|
||||
}
|
||||
|
||||
server {
|
||||
|
Loading…
Reference in New Issue
Block a user