mirror of
https://git.asonix.dog/asonix/relay.git
synced 2024-12-26 20:30:29 +00:00
30 lines
581 B
Docker
30 lines
581 B
Docker
FROM arm64v8/alpine:3.11.3 AS build
|
|
|
|
COPY relay /relay
|
|
|
|
RUN \
|
|
apk add binutils && \
|
|
strip /relay
|
|
|
|
FROM arm64v8/alpine:3.11.3
|
|
|
|
ARG UID=991
|
|
ARG GID=991
|
|
|
|
RUN \
|
|
apk add tini && \
|
|
echo "Etc/UTC" > /etc/localtime && \
|
|
mkdir -p /opt/relay && \
|
|
addgroup --gid $GID relay && \
|
|
adduser -D -u $UID -G relay -h /opt/relay relay && \
|
|
echo "relay:`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256`" | chpasswd && \
|
|
chown -R relay:relay /opt/relay
|
|
|
|
COPY --from=build /relay /usr/bin/relay
|
|
|
|
USER relay
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
CMD ["relay"]
|