Docker stuff

This commit is contained in:
Wolfgang Hottgenroth 2025-01-27 16:24:02 +01:00
parent 9b65eeee85
commit f96da3f8d4
Signed by: wn
GPG Key ID: 18FDFA577A8871AD
2 changed files with 29 additions and 0 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM python:3.12-alpine3.21
ARG APP_DIR="/opt/app"
ARG VERSION_ID1="x"
ARG VERSION_ID2="alpha"
COPY ./src/ ${APP_DIR}/
COPY start.sh ${APP_DIR}/
WORKDIR ${APP_DIR}
RUN \
apk add --no-cache build-base libpq-dev npm && \
pip install --upgrade pip && \
pip install -r requirements.txt && \
if [ "${VERSION_ID2}" != "" ]; then VERSION_ID=${VERSION_ID2}; else VERSION_ID=${VERSION_ID1}; fi && \
sed -i -e 's/VERSION_ID/'$VERSION_ID'/' ${APP_DIR}/templates/index.html && \
sed -i -e 's/VERSION_ID/'"$VERSION_ID"'/' ${APP_DIR}/templates/nutrition.html
EXPOSE 8080
CMD "./start.sh"

6
start.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
gunicorn 'Run:exposed_app' --bind 0.0.0.0:8080 --log-level=debug --workers=4