Skip to content

Commit

Permalink
Upgrade Dockerfile to reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
StdioA committed Aug 22, 2024
1 parent bb51c78 commit aafc967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
18 changes: 6 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM python:3.11
FROM python:3.11-slim

RUN apt-get update -q && apt-get install -y -q python3-lxml python3-numpy cmake sqlite3 && \
pip install --upgrade pip uv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir -p /app
RUN pip install --upgrade uv && mkdir -p /app
WORKDIR /app
COPY requirements-full.txt requirements-optional.txt /app/
ENV VIRTUAL_ENV=/packages/.venv
RUN mkdir -p $VIRTUAL_ENV && uv venv $VIRTUAL_ENV
COPY requirements-full.txt /app/
COPY requirements-optional.txt /app/
RUN uv pip install --no-cache-dir -r requirements-full.txt
RUN uv pip install --no-cache-dir -r requirements-optional.txt || true
RUN mkdir -p $VIRTUAL_ENV && uv venv $VIRTUAL_ENV && \
uv pip install --no-cache-dir -r requirements-full.txt && \
(uv pip install --no-cache-dir -r requirements-optional.txt || true)
COPY . /app

VOLUME /data/ledger
Expand Down

0 comments on commit aafc967

Please sign in to comment.