2020-05-11 16:28:37 +00:00
|
|
|
FROM alpine:latest as env
|
|
|
|
|
|
|
|
RUN apk --update add ca-certificates
|
|
|
|
RUN addgroup -S smartswitch && adduser -S smartswitch -G smartswitch
|
|
|
|
|
|
|
|
|
|
|
|
FROM golang:1.14 AS build
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . /src/
|
|
|
|
RUN make
|
|
|
|
|
|
|
|
|
2020-05-12 01:34:06 +00:00
|
|
|
FROM scratch
|
2020-05-11 16:28:37 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/srv/smartswitch-server"]
|
|
|
|
USER smartswitch
|
2020-05-12 01:34:06 +00:00
|
|
|
EXPOSE 7200
|
2020-05-11 16:28:37 +00:00
|
|
|
|
|
|
|
COPY --from=env /etc/passwd /etc/group /etc/
|
|
|
|
COPY --from=build --chown=smartswitch /src/build/ /srv/
|
|
|
|
COPY --from=env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
|