-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathDockerfile-workers
56 lines (49 loc) · 1.88 KB
/
Dockerfile-workers
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
FROM registry.fedoraproject.org/fedora:38
LABEL maintainer="Red Hat"
WORKDIR /src
RUN dnf -y install \
--setopt=deltarpm=0 \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
golang \
gcc \
git-core \
krb5-devel \
libffi-devel \
mercurial \
nodejs-npm-9.5.0 \
procps \
python3-devel \
python3-pip \
python3-setuptools \
strace \
&& dnf clean all
COPY . .
# All the requirements except pyarn should already be installed
RUN pip3 install -r requirements.txt --no-deps --no-cache-dir --require-hashes \
&& pip3 install . --no-deps --no-cache-dir \
&& rm -rf .git
# Install an older version of Go fixed at 1.20 (along with the base >= 1.21):
# - install Go's official shim
# - let the shim download the actual Go SDK (the download forces the output parent dir to $HOME)
# - move the SDK to a host local install system-wide location
# - remove the shim as it forces and expects the SDK to be used from $HOME
# - clean any build artifacts Go creates as part of the process.
RUN for go_ver in "go1.20" "go1.21.0"; do \
go install "golang.org/dl/${go_ver}@latest" && \
"$HOME/go/bin/$go_ver" download && \
mkdir -p /usr/local/go && \
mv "$HOME/sdk/$go_ver" /usr/local/go && \
rm -rf "$HOME/go" "$HOME/.cache/go-build/"; \
done
# Use the system CA bundle for the requests library
ENV REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/directory-hash/ca-bundle.crt
# Use the system CA bundle for native SSL calls from celery (python)
ENV SSL_CERT_FILE=/etc/pki/ca-trust/extracted/pem/directory-hash/ca-bundle.crt
# Set git user configuration for GitPython
ENV GIT_COMMITTER_NAME=cachito \
GIT_COMMITTER_EMAIL=cachito@localhost \
GIT_AUTHOR_NAME=cachito \
GIT_AUTHOR_EMAIL=cachito@localhost
EXPOSE 8080
CMD ["celery", "-A", "cachito.workers.tasks", "worker", "--loglevel=info"]