18 lines
347 B
Docker
18 lines
347 B
Docker
### 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 ./res /usr/app/res
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD [ "/usr/app/personalwebsite" ]
|