1
0
Fork 0
This repository has been archived on 2025-01-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
devops-with-docker/Part3/Exercise09/Dockerfile
2023-03-17 12:43:43 +02:00

12 lines
312 B
Docker

FROM golang:1.16.15-alpine3.15 as build-stage
WORKDIR /usr/src/app
COPY . .
RUN adduser -D appuser && CGO_ENABLED=0 go build
FROM scratch
EXPOSE 8080
ENV REQUEST_ORIGIN=http://devops:5000
COPY --from=build-stage /usr/src/app/server /
COPY --from=build-stage /etc/passwd /etc/passwd
USER appuser
CMD ["/server"]