-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (25 loc) · 919 Bytes
/
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
FROM python:3.10-slim
# Install runtime dependencies
ENV RUN_DEPS="curl"
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends $RUN_DEPS && \
rm -rf /var/lib/apt/lists/*
# Add dependency management files
COPY ./poetry.lock /app/
COPY ./pyproject.toml /app/
WORKDIR /app
# Install Poetry and Python packages
ENV POETRY_VERSION=1.3.2
RUN set -ex && \
curl -sSL https://install.python-poetry.org | python - --version=${POETRY_VERSION} && \
export PATH="/root/.local/bin:${PATH}" && \
poetry config virtualenvs.create false && \
# Install dependencies using poetry
poetry install && \
# Create output directory
mkdir -p /data
# Add application code
COPY . /app
# Run application
CMD ["/bin/bash", "-c", "/app/main.py --gitlab-url=${GITLAB_URL} --access-token=${GITLAB_ACCESS_TOKEN} --group-id=${GITLAB_GROUP_ID} --output-dir=/data ${ADDITIONAL_ARGS}"]