Docker_worker_enhance #155

Merged
mpeltriaux merged 4 commits from Docker_worker_enhance into Docker 2022-05-09 11:05:33 +02:00
3 changed files with 27 additions and 25 deletions
Showing only changes of commit 7d29dddd22 - Show all commits

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
upstream konova {
server konova:8000;
server localhost:8000;
}
server {