Update infra

This commit is contained in:
2023-01-05 21:56:57 +01:00
parent 2807c5e00e
commit e6b5804e37
7 changed files with 390 additions and 23 deletions

View File

@ -1,23 +1,26 @@
FROM node as css
COPY . /
RUN apt install -y npm && \
npm install && \
WORKDIR /app
COPY . /app
RUN npm install && \
npx tailwindcss -i ./src/input.css -o ./src/web/tracker/static/base.css --minify
FROM python:3.10-slim-bullseye
ENV VERSION_NUMBER 0.1.0-34-g8efce77
RUN useradd --create-home --uid 1000 timetracker && \
pip install --no-cache-dir poetry && \
poetry install --without dev
ENV VERSION_NUMBER 0.1.0-35-g2807c5e
ENV PROD 1
RUN useradd --create-home --uid 1000 timetracker
WORKDIR /home/timetracker/app
COPY . /home/timetracker/app/
RUN chown -R timetracker:timetracker /home/timetracker/app
COPY --from=css /app/src/web/tracker/static/base.css /home/timetracker/app/src/web/tracker/static/base.css
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
USER timetracker
ENV PATH="$PATH:/home/timetracker/.local/bin"
RUN pip install --no-cache-dir poetry
RUN poetry install --without dev
EXPOSE 8000
ENTRYPOINT [ "/entrypoint.sh" ]