-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile-313
More file actions
61 lines (49 loc) · 1.67 KB
/
Dockerfile-313
File metadata and controls
61 lines (49 loc) · 1.67 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM python:3.13-slim-trixie
# Add our worker users custom binaries to the path, some python packages are installed here.
ENV PATH="/home/worker/.local/bin:${PATH}"
# Never prompts the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
RUN useradd -ms /bin/bash worker
RUN apt-get update && \
apt-get install -yqq --no-install-recommends \
libpq-dev \
apt-utils \
build-essential \
ca-certificates \
curl \
git \
gnupg \
lsb-release \
wget \
unzip && \
apt-get remove --purge -yqq $buildDeps \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
USER worker
WORKDIR /home/worker/
# Put our pip installs, but not our own module install, here first so we can more rapidly build.
# pip installs take the longest.
COPY --chown=worker:root pyproject.toml ./pyproject.toml
COPY --chown=worker:root scripts/entrypoint.sh ./entrypoint.sh
COPY --chown=worker:root tests/ ./tests/
COPY --chown=worker:root databridge_etl_tools ./databridge_etl_tools
# Python syntax check
RUN python -m compileall ./databridge_etl_tools
# Install databridge-etl-tools using pyproject.toml
RUN pip install .
# Set aws access keys as an env var for use with boto3
# do this under the worker user.
# These are passed in via --build-arg at build time.
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
ENV AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["/home/worker/entrypoint.sh"]