Skip to content

Commit

Permalink
Experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Oct 4, 2024
1 parent 7f2b8ae commit 6775243
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker/Dockerfile.multistage
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"]

0 comments on commit 6775243

Please sign in to comment.