-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
47 lines (36 loc) · 982 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM --platform=$BUILDPLATFORM node:20 AS frontend
ARG TARGETOS
ARG TARGETARCH
WORKDIR /surmai
RUN mkdir node_modules
ADD src src
ADD public public
COPY .eslintrc.cjs .
COPY index.html .
COPY package.json .
COPY postcss.config.js .
COPY tsconfig.app.json .
COPY tsconfig.json .
COPY tsconfig.node.json .
COPY vite.config.ts .
RUN npm install -g [email protected] # For windows
RUN npm install --no-audit
RUN npm run build
FROM --platform=$BUILDPLATFORM golang:1.23.5-alpine3.21 AS backend
ARG TARGETOS
ARG TARGETARCH
WORKDIR /build
# Copy the go.mod and go.sum files to the /build directory
COPY backend/go.mod .
COPY backend/go.sum .
RUN go mod download
COPY backend .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o surmai-backend
FROM alpine:3.21
COPY backend/init.sh /pb/init.sh
COPY backend/datasets /datasets
COPY --from=frontend /surmai/dist /pb_public
COPY --from=backend /build/surmai-backend /pb/surmai-backend
EXPOSE 8080
# start PocketBase
CMD ["/pb/init.sh"]