Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.dockerignore
Dockerfile
.git

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
FROM --platform=linux/amd64 python:3.11
FROM --platform=linux/amd64 python:3.11@sha256:5062f6c22a2c3b8b3717c642af3852310d9a81c3c2c0fc72449a9a79ef09ae63

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

ENV UV_COMPILE_BYTECODE=1
ENV PYTHONUNBUFFERED=1

###################
## Parsons setup ##
###################

RUN mkdir /src
COPY . /src/
WORKDIR /src
COPY pyproject.toml setup.py ./
RUN uv sync --no-editable --all-extras --no-dev --python python3.11

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY . /src/

# Install parsons
RUN uv sync --upgrade --all-extras --python python3.11
ENV PATH="/src/.venv/bin:$PATH"
ENV PYTHONPATH=.:/app

# The /app directory can house the scripts that will actually execute on this Docker image.
# Eg. If using this image in a Civis container script, Civis will install your script repo
# (from Github) to /app.
# Eg. If using this image in a Civis container script,
# Civis will install your script repo (from Github) to /app.
RUN mkdir /app
WORKDIR /app

# Useful for importing modules that are associated with your python scripts:
ENV PYTHONPATH=.:/app
CMD ["python3"]
Loading