Compare commits

..

4 Commits

Author SHA1 Message Date
wpetit 13d3991a10 Merge pull request 'fix(docker): image now builds' (#3) from fix/dockerfile into develop
Reviewed-on: wpetit/fake-smtp#3
2024-02-27 17:19:38 +01:00
wpetit 4871876bf0 chore: use go run to exec modd 2024-02-27 17:19:16 +01:00
wpetit d47b819e1d feat(docker): use go 1.21 2024-02-27 17:14:25 +01:00
Philippe Caseiro f7bff1b697 fix(docker): image now builds
adding non root user execution capabilities
2024-02-27 17:09:30 +01:00
2 changed files with 8 additions and 7 deletions

View File

@ -51,7 +51,7 @@ tidy:
go mod tidy go mod tidy
watch: watch:
modd go run github.com/cortesi/modd/cmd/modd@v0.8.1
lint: lint:
golangci-lint run --enable-all golangci-lint run --enable-all

View File

@ -1,4 +1,4 @@
FROM golang:1.19 AS build FROM reg.cadoles.com/proxy_cache/library/golang:1.21 AS build
ARG HTTP_PROXY= ARG HTTP_PROXY=
ARG HTTPS_PROXY= ARG HTTPS_PROXY=
@ -18,14 +18,15 @@ RUN cp -f misc/docker/config-patch.txt misc/release/config-patch.txt \
&& npm ci \ && npm ci \
&& make ARCH_TARGETS=amd64 release && make ARCH_TARGETS=amd64 release
FROM busybox FROM reg.cadoles.com/proxy_cache/library/busybox
RUN adduser -D -h /app fsmtp
COPY --from=build /src/release/fake-smtp-linux-amd64 /app COPY --from=build /src/release/fake-smtp-linux-amd64 /app
RUN chown -R fsmtp:fsmtp /app
WORKDIR /app
RUN mkdir -p /app
EXPOSE 8080 2525 EXPOSE 8080 2525
USER fsmtp
WORKDIR /app
CMD ["bin/fake-smtp", "--config", "config.yml"] CMD ["bin/fake-smtp", "--config", "config.yml"]