forked from apicat/apicat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (22 loc) · 668 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM node:21-alpine3.18 AS frontend-builder
WORKDIR /app
COPY frontend/ /app/
RUN apk update \
&& apk add curl \
&& npm install -g pnpm \
&& pnpm i \
&& pnpm build
FROM golang:1.21 AS backend-builder
WORKDIR /app
COPY . /app/
COPY --from=frontend-builder /app/dist /app/frontend/dist
COPY --from=frontend-builder /app/embed.go /app/frontend/embed.go
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o apicat-server ./cmd/app/
FROM alpine:latest
WORKDIR /app
COPY ./wait-for-it.sh /app/wait-for-it.sh
COPY --from=backend-builder /app/apicat-server /app/apicat-server
RUN apk add bash \
&& chmod +x /app/wait-for-it.sh
ENTRYPOINT ["/app/apicat-server"]