Add dockerfile

This commit is contained in:
Ivan R. 2023-04-09 12:13:57 +05:00
parent c21b20f356
commit a1be7e81b7
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C
2 changed files with 30 additions and 1 deletions

29
Dockerfile Normal file
View file

@ -0,0 +1,29 @@
FROM golang:1.20.3-alpine AS builder
RUN apk add gcc
RUN apk add musl-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
COPY backend ./backend
COPY views ./views
RUN go build -o main
FROM alpine:3.17.3
WORKDIR /app
COPY --from=builder /app/main ./main
COPY assets ./assets
COPY templates ./templates
RUN mkdir /var/lib/phoenix
ENV PHOENIX_DB_PATH=/var/lib/phoenix/db.sqlite3
EXPOSE 8080
ENTRYPOINT ["/app/main"]

View file

@ -69,5 +69,5 @@ func main() {
views.DeleteLink(c, db)
})
r.Run()
r.Run(":8080")
}