-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (40 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
47 lines (40 loc) · 1.39 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.12-slim-bookworm
WORKDIR /app
COPY pyproject.toml poetry.toml poetry.lock ./
# hadolint ignore=DL4006,DL3008,DL3013
RUN --mount=type=secret,id=key,dst=/root/.ssh/id_rsa --mount=type=secret,id=netrc,dst=/root/.netrc \
apt-get update -yq \
&& apt-get install -yq --no-install-recommends \
ssh \
gcc \
python3-dev \
&& pip install --no-cache-dir --upgrade \
pip \
poetry \
&& export PATH="/root/.local/bin:$PATH" \
&& ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-root --without dev,test \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/pypoetry/artifacts/*
COPY logging.json logging.gcloud.json celeryconfig.py ./
COPY connectors_sync_worker connectors_sync_worker
ENV PATH="${PATH}:/root/.local/bin"
ENV GCS_READ_CACHE_MAX_SIZE_MB 0
ENV LOG_CONFIG logging.json
ENV prometheus_multiproc_dir /tmp
ENV PROMETHEUS_MULTIPROC_DIR /tmp
ENV PYTHONUNBUFFERED 1
ARG branch_name
ARG image
ARG name_for_logging
ARG short_sha
ARG version_for_logging
ENV BRANCH_NAME=${branch_name}
ENV GCP_IMAGE=${image}
ENV GIT_COMMIT=${short_sha}
ENV NAME_FOR_LOGGING=${name_for_logging}
ENV VERSION_FOR_LOGGING=${version_for_logging}
CMD ["celery", "--app=connectors_sync_worker.tasks", "worker"]