-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 694 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (23 loc) · 694 Bytes
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
FROM golang:rc-buster
ENV GOBIN=$GOPATH/bin
ENV PATH=$PATH:$GOBIN
ENV PATH=$PATH:$GOROOT/bin
# Install the application
WORKDIR $GOPATH/src/todoapi
COPY . ./
RUN go build -o $GOBIN/todoapi
# Set up a non-root user
RUN apt-get update && \
mkdir -p /mnt/data && \
useradd -ms /bin/bash foundit && \
chown -R foundit:foundit /mnt/data
# addgroup --gid 2323 "foundit" && \
# adduser --disabled-password \
# --home "/home/foundit" \
# --ingroup "foundit" \
# --no-create-home \
# --uid 2324 \
# "foundit" && \
EXPOSE 9000
USER foundit
ENTRYPOINT ["/go/bin/todoapi"]