Skip to content
Snippets Groups Projects
Unverified Commit d3ad1295 authored by Roman Karwacik's avatar Roman Karwacik
Browse files

Merge branch 'master' of git.fsmpi.rwth-aachen.de:videoaginfra/website

parents 2765c53d 7ff0aab6
No related branches found
No related tags found
No related merge requests found
FROM ubuntu
RUN mkdir -p /code
COPY requirements.txt /code
WORKDIR /code
RUN apt update && apt install python3 python3-flask sqlite python3-requests python3-lxml python3-ldap3 python3-icalendar python3-mysql.connector locales -y
RUN locale-gen de_DE.utf8
RUN apt install git -y
# Install uwsgi
RUN apt update && apt install python3-pip -y
RUN pip3 install uwsgi
# Install pylint
RUN pip3 install pylint
# Install nginx
RUN apt install nginx -y
COPY . /code
CMD ["bash", "/code/docker_start.sh"]
......@@ -53,3 +53,23 @@ Kurzform unter Ubuntu:
Mit python-eigenem Paketmanager:
`pip install -r requirements.txt`
---
### Alternative: Docker Image
Alternativ zu vorigem Setup kann zum lokalen Testen Docker verwendet werden, um die Testversion zu starten:
1. Lokal das Image erstellen mittels `docker build -t videoag .` in diesem Ordner.
2. Einen entsprechenden Container starten, z.B.: `docker run --rm --name=videoag -p 5000:5000 videoag`
- `--rm` löscht den Container nach dessen Terminierung
- `-p 5000:5000` mappt den Port, damit der Host auf die Webseite zugreifen kann. Nicht den lokalen Port ändern, da ansonsten ggf. Thumbnails oder Videos nicht mehr geladen werden können.
- Zusätzlich kann mittels `-v /lokaler/pfad/:/code` der Source-Code im Container mit dem Host gemounted werden.
3. Webseite unter `localhost:5000` besuchen.
In dieser Variante sollte in der `config.py` folgendes gesetzt werden:
```
SERVER_IP = 'localhost'
VIDEOPREFIX = '/files'
```
#!/bin/bash
# This file is executed when the docker container starts!
cd /code;
nginx -c nginx.conf.example -p . &
# Use -C argument to tell uwsgi to chmod 666 /uswgi.sock
exec uwsgi -C -s uwsgi.sock --manage-script-name --mount /=server:app --plugin python --enable-threads
......@@ -26,21 +26,22 @@ http {
keepalive_timeout 65;
types_hash_max_size 2048;
server {
#listen 5000;
listen 5000;
#listen [::]:5000;
listen localhost:5000;
#listen localhost:5000;
error_page 502 /static/500.html;
location /static/ {
root .;
}
location /files/ {
auth_request /auth;
auth_request /internal/auth;
auth_request_set $trackingcookie $upstream_http_set_cookie;
# For use with sshfs (recommended)
#alias /mnt/videoag/srv/videoag/released/;
#add_header Set-Cookie $trackingcookie;
# For use without sshfs
proxy_pass https://videoag.fsmpi.rwth-aachen.de/;
# NO TRAILING SLASH so that /files/ will not be skipped of the request!
proxy_pass https://videoag.fsmpi.rwth-aachen.de;
proxy_set_header Host "videoag.fsmpi.rwth-aachen.de";
proxy_set_header Set-Cookie $trackingcookie;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment