-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM golang:1.23-alpine AS gobuild | ||
|
||
WORKDIR /go/src/github.com/gimlet-io/capacitor | ||
|
||
COPY . . | ||
|
||
RUN mkdir -p bin | ||
RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/linux/amd64/capacitor github.com/gimlet-io/capacitor/cmd/capacitor | ||
|
||
FROM node:22-alpine AS npmbuild | ||
|
||
WORKDIR /src | ||
|
||
COPY web . | ||
|
||
RUN npm ci | ||
RUN npm run build | ||
|
||
FROM --platform=$TARGETPLATFORM alpine:3 | ||
|
||
RUN addgroup -S capacitor && adduser -S capacitor -G capacitor | ||
|
||
ADD docker/known_hosts /etc/ssh/ssh_known_hosts | ||
|
||
RUN mkdir /var/lib/capacitor | ||
RUN chown capacitor:capacitor /var/lib/capacitor | ||
WORKDIR /capacitor | ||
|
||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
|
||
COPY --from=gobuild --chown=capacitor:capacitor /go/src/github.com/gimlet-io/capacitor/bin/linux/amd64/capacitor capacitor | ||
COPY --from=npmbuild --chown=capacitor:capacitor /src/build ./web/build/ | ||
|
||
USER capacitor | ||
|
||
EXPOSE 9000 | ||
CMD ["/capacitor/capacitor"] |