fake-sms/misc/docker/Dockerfile
Philippe Caseiro 987208dd03 feat(docker): do not run container as root
Using a non root user to execute the application.
We don't need to be root
2024-02-26 11:54:51 +01:00

37 lines
782 B
Docker

FROM reg.cadoles.com/dh/library/golang:1.17 AS build
ARG HTTP_PROXY=
ARG HTTPS_PROXY=
ARG http_proxy=
ARG https_proxy=
RUN apt-get update && apt-get install -y build-essential git bash curl python2
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs
COPY . /src
WORKDIR /src
RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml
RUN go get github.com/krishicks/yaml-patch/cmd/yaml-patch
RUN npm install \
&& make vendor \
&& echo "---" > ./misc/release/config-patch.yml \
&& make ARCH_TARGETS=amd64 release
FROM busybox
RUN adduser -D -h /app sms
COPY --from=build /src/release/fake-sms-linux-amd64 /app
RUN chown -R sms:sms /app
USER sms
WORKDIR /app
CMD ["bin/fake-sms", "--config", "config.yml"]