docker: inital working setup
parent
33a07f8730
commit
fc9ae75d82
@ -0,0 +1,28 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
nginx:
|
||||
build: ./nginx/
|
||||
restart: always
|
||||
volumes:
|
||||
- uwsgi_data:/tmp/uwsgi/
|
||||
- web_static:/var/www/jdav_web/assets/:ro
|
||||
ports:
|
||||
- "8888:80"
|
||||
depends_on:
|
||||
- django
|
||||
|
||||
django:
|
||||
build: ./jdav_web/
|
||||
env_file: docker.env
|
||||
restart: always
|
||||
command: >
|
||||
sh -c "python manage.py collectstatic --noinput
|
||||
&& uwsgi --ini kompass.uwsgi.ini"
|
||||
volumes:
|
||||
- uwsgi_data:/tmp/uwsgi/
|
||||
- web_static:/code/static/
|
||||
- web_static:/var/www/jdav_web/assets/
|
||||
|
||||
volumes:
|
||||
uwsgi_data:
|
||||
web_static:
|
||||
@ -0,0 +1,18 @@
|
||||
DJANGO_ALLOWED_HOST='*'
|
||||
DJANGO_BASE_URL='localhost:8008'
|
||||
DJANGO_PROTOCOL='http'
|
||||
|
||||
EMAIL_HOST='hartley.uberspace.de'
|
||||
EMAIL_HOST_USER='post@flavigny.de'
|
||||
EMAIL_HOST_PASSWORD='Post00Flavigny..'
|
||||
EMAIL_SENDING_ADDRESS='post@flavigny.de'
|
||||
|
||||
DJANGO_DEPLOY=1
|
||||
|
||||
DJANGO_DATABASE_NAME='jdav_db'
|
||||
DJANGO_DATABASE_USER='jdav_db'
|
||||
DJANGO_DATABASE_PASSWORD='jdav00jdav'
|
||||
DJANGO_DATABASE_HOST='172.17.0.1'
|
||||
|
||||
DJANGO_SETTINGS_MODULE='jdav_web.settings'
|
||||
DJANGO_STATIC_ROOT='/var/www/jdav_web/assets'
|
||||
@ -0,0 +1,10 @@
|
||||
FROM python:3.9-bullseye
|
||||
RUN mkdir /code
|
||||
WORKDIR /code
|
||||
COPY . /code
|
||||
|
||||
# uwsgi setup
|
||||
RUN apt-get install libmariadb-dev
|
||||
RUN pip install uwsgi
|
||||
RUN pip install -r requirements.txt
|
||||
CMD ["uwsgi", "--ini", "/web/kompass.uwsgi.ini"]
|
||||
@ -0,0 +1,8 @@
|
||||
[uwsgi]
|
||||
|
||||
socket = /tmp/uwsgi/kompass.sock
|
||||
module = jdav_web.wsgi
|
||||
master = true
|
||||
processes = 2
|
||||
chmod-socket = 666
|
||||
vacuum = true
|
||||
@ -0,0 +1,8 @@
|
||||
FROM nginx:latest
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY kompass.nginx.conf /etc/nginx/sites-available/kompass.nginx.conf
|
||||
RUN mkdir /etc/nginx/sites-enabled
|
||||
RUN ln -s /etc/nginx/sites-available/kompass.nginx.conf /etc/nginx/sites-enabled/
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -0,0 +1,20 @@
|
||||
upstream uwsgi {
|
||||
server unix:/tmp/uwsgi/kompass.sock;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name 127.0.0.1;
|
||||
charset utf-8;
|
||||
|
||||
location /static {
|
||||
alias /var/www/jdav_web/assets;
|
||||
}
|
||||
|
||||
location / {
|
||||
uwsgi_pass uwsgi;
|
||||
include /etc/nginx/uwsgi_params;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
user root;
|
||||
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local]
|
||||
"$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
#include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue