diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3271313 --- /dev/null +++ b/Dockerfile @@ -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" + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..acc9438 --- /dev/null +++ b/start.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +gunicorn 'Run:exposed_app' --bind 0.0.0.0:8080 --log-level=debug --workers=4 + + +