timetracker/Dockerfile

20 lines
709 B
Docker
Raw Normal View History

2023-01-02 17:11:43 +00:00
FROM python:3.10-slim-bullseye
2023-01-02 17:37:45 +00:00
RUN apt update \
&& apt install --no-install-recommends --yes \
git \
2023-01-02 23:15:17 +00:00
make \
2023-01-02 17:37:45 +00:00
&& rm -rf /var/lib/apt/lists/*
2023-01-02 17:11:43 +00:00
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv pip $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install --no-cache-dir poetry
RUN useradd --create-home --uid 1000 timetracker
RUN git clone https://git.kucharczyk.xyz/lukas/timetracker.git /home/timetracker/app
WORKDIR /home/timetracker/app
2023-01-02 17:26:24 +00:00
RUN chown -R timetracker /home/timetracker/app
2023-01-02 17:11:43 +00:00
RUN poetry install
2023-01-03 11:36:44 +00:00
RUN make migrate && make loadplatforms
2023-01-02 17:11:43 +00:00
EXPOSE 8000
2023-01-03 11:34:50 +00:00
VOLUME [ "/home/timetracker/app/src/web/db.sqlite3" ]
2023-01-02 17:26:24 +00:00
USER timetracker
CMD [ "python3", "src/web/manage.py", "runserver", "0.0.0.0:8000" ]