Skip to content
Snippets Groups Projects
Commit 9fbd628f authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Add Containerfile and Gunicorn example config for deployment

parent 3d75a78c
No related branches found
No related tags found
No related merge requests found
.gitignore
\ No newline at end of file
*.pdf
/instance
/schilder2000/static
/gunicorn.conf.py
# Byte-compiled / optimized / DLL files
__pycache__/
......
FROM docker.io/library/node:20-alpine AS build-node
WORKDIR /usr/app
COPY . .
RUN ["npm", "ci"]
RUN ["npm", "run", "build"]
FROM docker.io/library/python:3.12-alpine AS build-python
WORKDIR /usr/src/app
COPY . .
COPY --from=build-node /usr/app/schilder2000/static ./schilder2000/static
RUN ["apk", "add", "git"]
RUN ["pip", "install", "build"]
RUN ["pyproject-build", "-C", "without-npm"]
FROM docker.io/library/python:3.12-alpine
RUN ["apk", "add", "pango", "font-terminus", "font-inconsolata", "font-dejavu", "font-noto", "font-noto-cjk", "font-awesome", "font-noto-extra", "libldap", "mariadb-connector-c"]
COPY --from=build-python /usr/src/app/dist/schilder2000-*.whl /tmp/
RUN apk add -t .build-deps build-base mysql-dev openldap-dev git && \
pip install gunicorn /tmp/schilder2000-*.whl schilder2000[all] && \
rm /tmp/schilder2000-*.whl && \
apk del .build-deps
VOLUME /usr/local/var/schilder2000-instance/
COPY examples /usr/local/var/schilder2000-instance
WORKDIR /usr/local/var/schilder2000-instance/
ENV FLASK_APP=schilder2000
CMD ["gunicorn", "schilder2000:create_app()"]
wsgi_app = "schilder2000:create_app()"
bind = "[::]:8080"
accesslog = "-"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment