Packaging and docker publishing

This commit is contained in:
Yax 2025-09-14 16:02:25 +02:00
parent e4fb12d173
commit 5797dc0dee
7 changed files with 127 additions and 32 deletions

31
Dockerfile Normal file
View file

@ -0,0 +1,31 @@
FROM python:3.13.1-alpine3.20
ARG DIST_VERSION=1.0
ARG DIST_FILENAME=dumbremind-${DIST_VERSION}-py3-none-any.whl
RUN apk update && apk add bash && apk add wget
# Timezone
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN echo "Europe/Paris" > /etc/timezone
# Clean apk cache
RUN rm -rf /var/cache/apk/*
COPY docker/docker-init.sh /usr/local/bin/
RUN chmod +x usr/local/bin/docker-init.sh
RUN cd /
COPY dist/${DIST_FILENAME} /
RUN python3 -m pip install ${DIST_FILENAME}
# --target /app
RUN rm -f ${DIST_FILENAME}
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NEVER PUBLISH IMAGE ON PUBLIC REPOSITORY
COPY .env /.env
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WORKDIR /
CMD ["docker-init.sh"]