Compare commits

..

No commits in common. "7027e0c02bd58ba8e813d14337713976048ee02d" and "f50f17d593231adf22792d48279dea2eca73c86f" have entirely different histories.

5 changed files with 37 additions and 20 deletions

View File

@ -1,21 +1,17 @@
FROM python:3.9-slim
FROM python:3.7-slim
ENV PYTHONUNBUFFERED 1
WORKDIR /konova
# Install some dependencies
RUN apt update
RUN apt install -y gdal-bin redis-server nginx
RUN apt install -y gdal-bin
# Copy requirements file into workspace and install all dependencies
# Copy requirements file into workspace
COPY ./requirements.txt /konova/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Remove nginx default configuration and replace with own configuration
RUN rm /etc/nginx/sites-enabled/default
COPY ./nginx.conf /etc/nginx/conf.d
# Copy rest of project into workspace
COPY . /konova/

View File

@ -1,34 +1,58 @@
version: '3.3'
services:
redis:
image: redis
container_name: "konova-redis-cache"
volumes:
- /redis/data:/bitnami/redis/data
environment:
- REDIS_PASSWORD=CHANGE_ME
konova:
external_links:
- postgis:db
- arnova-nginx-server:arnova
build: .
container_name: "konova-docker"
command: ./docker-entrypoint.sh
command: sh -c 'celery -A konova worker -l INFO --detach && gunicorn konova.wsgi:application --bind 0.0.0.0:8000'
restart: always
volumes:
- .:/konova
- /data/apps/konova/uploaded_files:/konova_uploaded_files
ports:
- "1337:80"
- /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
environment:
- POSTGRES_NAME=konova
- POSTGRES_PORT=5432
- POSTGRES_PASSWORD=CHANGE_ME
- POSTGRES_USER=konova
- POSTGRES_HOST=db
- REDIS_HOST=localhost
- REDIS_HOST=redis
- 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
# 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
networks:
default:
external:
name: postgis_nat_it_backend
volumes:
static_file_volume:

View File

@ -1,7 +0,0 @@
#!/bin/bash
# Start all needed services once the container is fired up!
service nginx start
service redis-server start
celery -A konova worker --detach
# Rule of thumb: (2*CPU)+1 as worker_num -> Use 5 as default (matches a dual core)
gunicorn --workers=5 konova.wsgi:application --bind=0.0.0.0:8000

4
nginx/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM nginx:alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d

View File

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