forked from centralmind/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 762 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (19 loc) · 762 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 alpine:3.19
ENV TZ=Etc/UTC, ROTATION_TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN echo $TZ > /etc/timezone && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
# Create a non-root user and group
RUN addgroup --system cligroup && adduser --system --ingroup cligroup cliuser
# Create necessary directories with proper permissions
RUN mkdir -p /var/log/gateway /etc/gateway && \
chown -R cliuser:cligroup /var/log/gateway /etc/gateway && \
chmod 755 /var/log/gateway /etc/gateway
ARG BINARY=gateway
COPY ${BINARY} /usr/local/bin/gw
RUN chmod +x /usr/local/bin/gw
# Set ownership of the binary to the non-root user
RUN chown cliuser:cligroup /usr/local/bin/gw
# Switch to the non-root user
USER cliuser
ENTRYPOINT ["/usr/local/bin/gw"]