diff --git a/.gitignore b/.gitignore index 06b677c4..99ce7635 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ run *.pid *~ APIKEY.txt +tmp \ No newline at end of file diff --git a/.theia-workspace b/.theia-workspace index c94c9c93..3751ec5e 100644 --- a/.theia-workspace +++ b/.theia-workspace @@ -9,6 +9,10 @@ "launch": {}, "python.linting.flake8Enabled": true, "python.linting.banditEnabled": true, - "python.testing.pytestEnabled": true + "python.testing.pytestEnabled": true, + "workbench.colorTheme": "light", + "python.linting.flake8Args": [ + "--max-line-length=100" + ] } } \ No newline at end of file diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 00000000..16a5a54c --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,30 @@ +FROM tiangolo/uwsgi-nginx:python3.8-alpine AS builder + +RUN python -m venv /opt/venv +# Make sure we use the virtualenv: +ENV PATH="/opt/venv/bin:$PATH" + +RUN apk add --no-cache --virtual .build-deps ca-certificates gcc linux-headers \ + musl-dev jpeg-dev zlib-dev libffi-dev mysql mariadb-dev git \ + && pip install --upgrade pip + +COPY ./fet2020/requirements.txt /app/requirements.txt + +RUN pip install -r requirements.txt + + +FROM tiangolo/uwsgi-nginx:python3.8-alpine + +RUN apk add ghostscript-dev mariadb-connector-c +COPY --from=builder /opt/venv /opt/venv + +# Make sure we use the virtualenv: +ENV PATH="/opt/venv/bin:$PATH" + +COPY ./tmp/fet2020/fet2020 /app +COPY ./tmp/fet2020/assets /app/assets +COPY ./deployment/nginx.conf /etc/nginx/conf.d/fet2020.conf + +#RUN python manage.py makemigrations && python manage.py makemigrations posts members + + diff --git a/push_docker b/push_docker new file mode 100755 index 00000000..92797a0f --- /dev/null +++ b/push_docker @@ -0,0 +1,7 @@ +#/bin/bash +export REGISTRY="docker.triton2.fet.at" +git clone https://git.fet.at/bofh/fet2020.git tmp/fet2020 +# Build a development Image with Theia and all content +docker build -f Dockerfile.test -t $REGISTRY/fet2020django:latest . +docker push $REGISTRY/fet2020django +rm -rf ./tmp/fet2020 \ No newline at end of file