-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDockerfile.workerpython.debian
More file actions
52 lines (33 loc) · 1.16 KB
/
Dockerfile.workerpython.debian
File metadata and controls
52 lines (33 loc) · 1.16 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
FROM golang:1.21-alpine as builder
RUN mkdir -p /go/src/build
WORKDIR /go/src/build
COPY go.mod /go/src/build/go.mod
COPY go.sum /go/src/build/go.sum
RUN go mod download
ADD app /go/src/build/app
ARG DATAPLANE_VERSION=latest
RUN CGO_ENABLED=0 go build -ldflags "-X github.com/dataplane-app/dataplane/app/workers/config.Version=$DATAPLANE_VERSION" -o dataplane-worker app/workers/worker.go
FROM python:3.12.0-bookworm
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
RUN apt-get update && apt install -y htop && rm -rf /var/lib/apt/lists/*
# Create appuser
ENV USER=appuser
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/dataplane" \
--shell "/sbin/nologin" \
# --no-create-home \
--uid "${UID}" \
"${USER}"
COPY --from=builder go/src/build/dataplane-worker /dataplane/dataplane-worker
RUN chmod +x /dataplane/dataplane-worker
RUN mkdir /dataplane/code-files/ && chown -R appuser:appuser /dataplane
RUN chmod +w /dataplane/code-files/
RUN mkdir /dataplane/dfs-code-files/ && chown -R appuser:appuser /dataplane
RUN chmod +w /dataplane/dfs-code-files/
WORKDIR /dataplane
USER appuser:appuser
CMD ["./dataplane-worker"]