forked from nasa/stitchee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.03 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (29 loc) · 1.03 KB
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
FROM python:3.12-slim
# System setup, package installation, and cleanup are run in a single layer
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
gcc \
libnetcdf-dev \
&& pip3 install --upgrade pip cython uv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create user and workspace
RUN adduser --quiet --disabled-password --shell /bin/sh \
--home /home/dockeruser --gecos "" --uid 1000 dockeruser \
&& mkdir -p /worker \
&& chown dockeruser:dockeruser /worker
# Set working directory
WORKDIR /worker
# Copy project files and install (as root for system-wide installation)
COPY pyproject.toml README.md LICENSE ./
COPY stitchee/ ./stitchee/
RUN uv sync --extra harmony
# Copy and prepare entrypoint
COPY docker-entrypoint.sh ./
RUN chmod +x ./docker-entrypoint.sh \
&& chown dockeruser:dockeruser ./docker-entrypoint.sh
# Switch to non-root user for runtime
USER dockeruser
ENV HOME=/home/dockeruser \
PYTHONPATH="/worker"
ENTRYPOINT ["./docker-entrypoint.sh"]