add dockerfile

This commit is contained in:
cyber-dream 2023-03-21 15:38:03 +03:00
parent 56d2804626
commit 1175cf3e98

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
### 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" ]