Compare commits
No commits in common. "7027e0c02bd58ba8e813d14337713976048ee02d" and "f50f17d593231adf22792d48279dea2eca73c86f" have entirely different histories.
7027e0c02b
...
f50f17d593
10
Dockerfile
10
Dockerfile
@ -1,21 +1,17 @@
|
|||||||
FROM python:3.9-slim
|
FROM python:3.7-slim
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
WORKDIR /konova
|
WORKDIR /konova
|
||||||
|
|
||||||
# Install some dependencies
|
# Install some dependencies
|
||||||
RUN apt update
|
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/
|
COPY ./requirements.txt /konova/
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
RUN pip install -r requirements.txt
|
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 rest of project into workspace
|
||||||
COPY . /konova/
|
COPY . /konova/
|
||||||
|
|
||||||
|
@ -1,34 +1,58 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
container_name: "konova-redis-cache"
|
||||||
|
volumes:
|
||||||
|
- /redis/data:/bitnami/redis/data
|
||||||
|
environment:
|
||||||
|
- REDIS_PASSWORD=CHANGE_ME
|
||||||
|
|
||||||
konova:
|
konova:
|
||||||
external_links:
|
external_links:
|
||||||
- postgis:db
|
- postgis:db
|
||||||
- arnova-nginx-server:arnova
|
- arnova-nginx-server:arnova
|
||||||
build: .
|
build: .
|
||||||
container_name: "konova-docker"
|
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
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- .:/konova
|
- .:/konova
|
||||||
- /data/apps/konova/uploaded_files:/konova_uploaded_files
|
- /path/to/host/folder:/konova_uploaded_files
|
||||||
ports:
|
- static_file_volume:/konova/static # Point to the volume for static files. Shared with nginx service
|
||||||
- "1337:80"
|
expose:
|
||||||
|
- 8000
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_NAME=konova
|
- POSTGRES_NAME=konova
|
||||||
- POSTGRES_PORT=5432
|
- POSTGRES_PORT=5432
|
||||||
- POSTGRES_PASSWORD=CHANGE_ME
|
- POSTGRES_PASSWORD=CHANGE_ME
|
||||||
- POSTGRES_USER=konova
|
- POSTGRES_USER=konova
|
||||||
- POSTGRES_HOST=db
|
- POSTGRES_HOST=db
|
||||||
- REDIS_HOST=localhost
|
- REDIS_HOST=redis
|
||||||
- SSO_HOST=CHANGE_ME_TO_SSO_HOST_URL
|
- SSO_HOST=CHANGE_ME_TO_SSO_HOST_URL
|
||||||
- SMTP_HOST=172.17.0.1
|
- SMTP_HOST=172.17.0.1
|
||||||
- SMTP_PORT=25
|
- SMTP_PORT=25
|
||||||
- SMTP_REAL_REPLY_MAIL=ksp-servicestelle@sgdnord.rlp.de
|
- 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
|
# 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
|
# NOTE: THIS NETWORK MUST EXIST
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
external:
|
external:
|
||||||
name: postgis_nat_it_backend
|
name: postgis_nat_it_backend
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
static_file_volume:
|
@ -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
4
nginx/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
RUN rm /etc/nginx/conf.d/default.conf
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d
|
@ -1,5 +1,5 @@
|
|||||||
upstream konova {
|
upstream konova {
|
||||||
server localhost:8000;
|
server konova:8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
Loading…
Reference in New Issue
Block a user