[+] improve project layout

This commit is contained in:
Siarhei Siniak 2025-07-01 11:03:55 +03:00
parent 7fb9aae90e
commit a0f1654cf5
6 changed files with 58 additions and 0 deletions

@ -0,0 +1,3 @@
.venv
tmp
.git

@ -0,0 +1,20 @@
services:
web:
build:
context: .
dockerfile: ./docker/web/Dockerfile
target: web
environment:
volumes:
- .:/app:ro
- ./tmp/cache:/app/tmp/cache:rw
logging:
driver: "json-file"
options:
max-size: 10m
max-file: "3"
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M

@ -0,0 +1,34 @@
FROM docker.io/library/python:3.12@sha256:6121c801703ec330726ebf542faab113efcfdf2236378c03df8f49d80e7b4180 AS base
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
COPY docker/web/apt.requirements.txt docker/web/apt.requirements.txt
RUN apt-get update \
&& apt-get install -y $(cat docker/web/apt.requirements.txt)
RUN \
pip3 install \
--break-system-packages uv
COPY requirements.txt requirements.txt
RUN \
--mount=type=bind,source=releases/whl,target=/app/releases/whl \
--mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/uv \
uv pip \
install \
--system \
--break-system-packages \
-f releases/whl \
-r requirements.txt
WORKDIR /app
RUN apt-get update -yy && apt-get install -yy tini
FROM base as web
ENTRYPOINT ["tini", "--"]
CMD ["/usr/bin/python3", "-m", "d1.reload"]

@ -0,0 +1 @@
wget tar git curl