-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (26 loc) · 1.19 KB
/
Dockerfile
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
ARG PYTHON_BASE=3.12-slim
FROM python:$PYTHON_BASE AS builder
# Install Doppler CLI
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg && \
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | tee /etc/apt/sources.list.d/doppler-cli.list && \
apt-get update && \
apt-get -y install doppler &&\
doppler --version
# Install pdm
RUN pip install -U pdm
ENV PDM_CHECK_UPDATE=false
# Copy project files
COPY pyproject.toml pdm.lock README.md /project/
COPY src/ /project/src
# Install dependencies
WORKDIR /project
RUN pdm install --check --prod --no-editable
# Runing
FROM python:$PYTHON_BASE
# From building stage copy the virtual environment
COPY --from=builder /project/.venv/ /project/.venv
COPY --from=builder /usr/bin/doppler /usr/bin/doppler
ENV PATH="/project/.venv/bin:$PATH"
COPY src /project/src
CMD ["doppler", "run", "--", "/project/.venv/bin/python", "/project/src/feedrss.py"]