-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
47 lines (37 loc) · 1.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.11-slim
# Install Node.js 18+
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
make \
curl \
gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Copy and set working directory
COPY . /app
WORKDIR /app
ENV PATH="/root/.cargo/bin/:$PATH"
# Download the latest installer
ADD https://astral.sh/uv/0.4.17/install.sh /uv-installer.sh
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Install just
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
# Install Python dependencies using uv
RUN uv sync
RUN uv pip install -r pyproject.toml --no-build-isolation
RUN pip install pre-commit
# Setup git hooks
RUN git config --global --add safe.directory /app && \
pre-commit install
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Create volume for caches
VOLUME [ "/app/.pytest_cache", "/app/.ruff_cache" ]
# Set just as the entrypoint with a default command
ENTRYPOINT ["/usr/local/bin/just"]
CMD ["--list"]