-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.prod
More file actions
29 lines (27 loc) · 1.38 KB
/
Copy pathDockerfile.prod
File metadata and controls
29 lines (27 loc) · 1.38 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
FROM ghcr.io/miguelcarcamov/snow:base
# Install build tools first (smaller, can be cleaned up separately)
RUN python3 -m pip install --upgrade --no-cache-dir pip wheel setuptools setuptools-scm build && \
python3 -m pip cache purge
# Build and install snow with maximum space efficiency
# Use /tmp/snow-build which we'll clean up immediately after
RUN WORKDIR=/tmp/snow-build && \
mkdir -p $WORKDIR && \
cd $WORKDIR && \
echo "Cloning snow repository..." && \
git clone --depth 1 --single-branch https://github.com/miguelcarcamov/snow.git . && \
echo "Building snow package..." && \
python3 -m build --wheel && \
echo "Installing snow..." && \
pip3 install --no-cache-dir $(ls -t dist/*.whl | head -1) && \
cd / && \
rm -rf $WORKDIR && \
python3 -m pip cache purge && \
rm -rf /root/.cache/pip /root/.cache/pip-tools /root/.cache/git && \
rm -rf /tmp/* /var/tmp/* && \
find /usr/local/lib/python3.* -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local/lib/python3.* -type f \( -name "*.pyc" -o -name "*.pyo" \) -delete 2>/dev/null || true && \
mkdir -p ~/.casa/data && \
echo "Hello from snow production image"
LABEL org.opencontainers.image.source="https://github.com/miguelcarcamov/snow"
LABEL org.opencontainers.image.description="Container image for SNOW"
LABEL org.opencontainers.image.licenses=GPL3