-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (21 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
26 lines (21 loc) · 854 Bytes
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
# Define base container image (platform has to be defined if using with ARM64 architecture)
FROM python:3.11-slim AS opcoord-base
#FROM --platform=linux/amd64 python:3.11-slim as rao-base
# Set non root user
ARG GID=1000
ARG UID=1000
RUN groupadd -g ${GID} appuser && useradd --create-home --no-log-init -u ${UID} -g ${GID} appuser
# Install tools to set up python environment
RUN apt-get update && apt-get install -y --no-install-recommends procps && rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade setuptools pip uv
# Set working directory
WORKDIR /app
# Sync python modules as dependencies
COPY pyproject.toml .
COPY uv.lock .
RUN uv export -o pylock.toml
RUN uv pip sync pylock.toml --system && uv cache clean
# Copy license file and dependencies license reference
RUN mkdir -p /licenses
COPY LICENSE /licenses/
COPY licenses/ /licenses/