-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (21 loc) · 712 Bytes
/
Dockerfile
File metadata and controls
23 lines (21 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:1.23-alpine AS backend
COPY . /go/src/github.com/beadko/mywinebook
WORKDIR /go/src/github.com/beadko/mywinebook
RUN apk add --no-cache build-base
RUN go mod download
RUN CGO_ENABLED=1 go build -o mywinebook .
FROM node:18-alpine AS frontend-build
COPY frontend /opt/my-wine-book/
WORKDIR /opt/my-wine-book/
RUN npm install
RUN npm run build
FROM alpine
WORKDIR /opt/mywinebook/
COPY --from=backend /go/src/github.com/beadko/mywinebook/mywinebook bin/
COPY --from=frontend-build /opt/my-wine-book/dist static
RUN chmod +x bin/mywinebook
RUN mkdir -p data/wine/images data/cert-cache
RUN ["/opt/mywinebook/bin/mywinebook", "init"]
CMD ["/opt/mywinebook/bin/mywinebook", "server"]
EXPOSE 80
EXPOSE 443