hsman/docker/Dockerfile

37 lines
734 B
Docker

# syntax = docker/dockerfile:1.2
FROM python:3.12.2-alpine3.19
ARG APP_VERSION
ARG APP_SHA
ARG BUILD_DATE
ENV APP_VERSION=${APP_VERSION:-alpha0}
ENV APP_SHA=${APP_SHA:-000000}
# useful in case we want to run in debug mode
ENV FLASK_APP /hsman/wsgi.py
ENV FLASK_ENV production
RUN apk --update --no-cache add \
bash \
build-base \
libffi-dev \
curl && \
chmod g+w /run && \
pip install poetry gunicorn
COPY . /hsman
RUN cd hsman && \
poetry install && \
poetry export | pip install -r /dev/stdin
WORKDIR /hsman
HEALTHCHECK --interval=20s --timeout=3s CMD curl -I -s -o /dev/null localhost:5000/health || exit 1
EXPOSE 5000
# exectute start up script
ENTRYPOINT ["/hsman/docker/entrypoint.sh"]