personal-website/Dockerfile

18 lines
359 B
Docker
Raw Permalink Normal View History

2023-03-21 12:38:03 +00:00
### STAGE 1: build ###
FROM golang:1.18-alpine AS build
WORKDIR /usr/app
COPY . .
RUN go build .
RUN ls -a
### STAGE 2: Run ###
FROM golang:1.18-alpine
WORKDIR /usr/app
COPY --from=build /usr/app/personalwebsite /usr/app/personalwebsite
COPY ./templates /usr/app/templates
COPY ./resources /usr/app/resources
EXPOSE 8080
CMD [ "/usr/app/personalwebsite" ]