init new dev project

This commit is contained in:
2021-05-23 10:14:48 +00:00
commit 4eb41723cf
6 changed files with 99 additions and 0 deletions

2
Dockerfile.nginx Normal file
View File

@@ -0,0 +1,2 @@
from nginx:alpine
copy ./config/default.conf /etc/nginx/conf.d/default.conf

11
Dockerfile.theia Normal file
View File

@@ -0,0 +1,11 @@
from theiaide/theia-python:latest
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install libgs-dev \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt .
run pip3 install --upgrade pip && pip3 install -r requirements.txt && pip3 install pytest pylint bandit flake8 black pytest-django six pytest-mock
#COPY . /home/project
RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz && tar -xvf docker-20.10.2.tgz docker/docker && cp docker/docker /usr/bin/
#ENTRYPOINT node /home/theia/src-gen/backend/main.js /home/project/ --hostname=0.0.0.0

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
# About
Dieses kleine Projekt zeigt wie mit Docker und einigen Tools eine kleine Online Entwicklungsumgebung aufgesetzt werden kann.
Primär ist diese Umgebung für Python Projekte gedacht, kann aber insbesondere auch für Node.js und andere Themen genutzt werden.

9
build_push Executable file
View File

@@ -0,0 +1,9 @@
#/bin/bash
export REGISTRY="docker.triton2.fet.at"
# Build a development Image with Theia and all content
#docker build --no-cache -f Dockerfile.nginx -t $REGISTRY/dev_nginx:latest .
#docker push $REGISTRY/dev_nginx:latest
docker build --no-cache -f Dockerfile.theia -t $REGISTRY/dev_theia:latest .
docker push $REGISTRY/dev_theia:latest

70
config/default.conf Normal file
View File

@@ -0,0 +1,70 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
resolver 127.0.0.11 valid=30s;
set $theia theia;
set $etherpad etherpad;
set $dokuwiki dokuwiki;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
client_max_body_size 10M;
location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
proxy_ssl_server_name on;
proxy_ssl_verify off;
proxy_pass http://$theia:5001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /dokuwiki {
rewrite /dokuwiki/(.*) /$1 break;
rewrite ^/dokuwiki$ /dokuwiki/ permanent;
proxy_pass http://$dokuwiki:8080;
proxy_redirect / /dokuwiki/;
proxy_set_header Host $host;
proxy_buffering off;
}
location /etherpad {
rewrite /etherpad/(.*) /$1 break;
rewrite ^/etherpad$ /etherpad/ permanent;
proxy_pass http://$etherpad:9001;
proxy_redirect / /etherpad/;
proxy_set_header Host $host;
proxy_buffering off;
sub_filter /static/plugins/ /etherpad/static/plugins/;
sub_filter /etherpad/etherpad/static/plugins/ /etherpad/static/plugins/;
sub_filter_once off;
}
location /dev {
rewrite_log on;
rewrite /dev/(.*) /$1 break;
rewrite ^/dev$ /dev/ permanent;
proxy_set_header Host $host;
proxy_set_header Proxy "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarde-Proto $scheme;
proxy_buffering off;
proxy_pass http://$theia:3000;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

0
requirements.txt Normal file
View File