FROM ubuntu:latest
LABEL authors="Damian"

FROM golang:alpine AS GO_BUILD
COPY ./ /server
WORKDIR /server
ADD go.mod .
ADD go.sum .
RUN go mod download
RUN go build -o /go/bin/server


FROM alpine:3.15
WORKDIR app
COPY --from=GO_BUILD /go/bin/server ./
COPY ./ .
COPY .env ./
COPY ./templates ./templates/
COPY ./assets ./assets/
CMD ./server