Skip to content

Commit 6775243

Browse files
committed
Experiment
1 parent 7f2b8ae commit 6775243

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docker/Dockerfile.multistage

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM golang:1.23-alpine AS gobuild
2+
3+
WORKDIR /go/src/github.com/gimlet-io/capacitor
4+
5+
COPY . .
6+
7+
RUN mkdir -p bin
8+
RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/linux/amd64/capacitor github.com/gimlet-io/capacitor/cmd/capacitor
9+
10+
FROM node:22-alpine AS npmbuild
11+
12+
WORKDIR /src
13+
14+
COPY web .
15+
16+
RUN npm ci
17+
RUN npm run build
18+
19+
FROM --platform=$TARGETPLATFORM alpine:3
20+
21+
RUN addgroup -S capacitor && adduser -S capacitor -G capacitor
22+
23+
ADD docker/known_hosts /etc/ssh/ssh_known_hosts
24+
25+
RUN mkdir /var/lib/capacitor
26+
RUN chown capacitor:capacitor /var/lib/capacitor
27+
WORKDIR /capacitor
28+
29+
ARG TARGETPLATFORM
30+
ARG BUILDPLATFORM
31+
32+
COPY --from=gobuild --chown=capacitor:capacitor /go/src/github.com/gimlet-io/capacitor/bin/linux/amd64/capacitor capacitor
33+
COPY --from=npmbuild --chown=capacitor:capacitor /src/build ./web/build/
34+
35+
USER capacitor
36+
37+
EXPOSE 9000
38+
CMD ["/capacitor/capacitor"]

0 commit comments

Comments
 (0)