This commit is contained in:
Raphael Rouiller
2024-07-08 14:06:52 +02:00
commit aa54287126
96 changed files with 2718 additions and 0 deletions

41
stat/Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM python:3.11-slim
# declaration of service variables environment
ENV STAT_SERVICE_NAME=${STAT_SERVICE_NAME}
ENV DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME}
ENV DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}
ENV DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD}
ARG STAT_SERVICE_NAME
ARG DJANGO_SUPERUSER_USERNAME
ARG DJANGO_SUPERUSER_EMAIL
ARG DJANGO_SUPERUSER_PASSWORD
COPY ./user_statistics /home/archive/${STAT_SERVICE_NAME}
# declaration of environment variables for python
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
RUN mkdir -p /home/archive
WORKDIR /home/archive
# installation of dependencies
COPY ./conf/requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt \
&& mkdir depedencies && mv requirements.txt depedencies
# installation of postgresql-client
RUN apt-get update && apt-get install -y postgresql-client
RUN apt-get update && apt-get install -y netcat-openbsd
RUN mkdir -p logs
# copy and execute the initialization script
COPY ./tools/init.sh /home/archive/init.sh
# set the final working directory
WORKDIR /home/archive/${STAT_SERVICE_NAME}
# Command for running the application
CMD ["/bin/bash", "/home/archive/init.sh"]