mirror of
https://github.com/ordinary-dev/phoenix
synced 2024-09-20 03:40:29 +05:00
Add dockerfile
This commit is contained in:
parent
c21b20f356
commit
a1be7e81b7
29
Dockerfile
Normal file
29
Dockerfile
Normal 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"]
|
Loading…
Reference in a new issue