Skip to content

Commit

Permalink
fix(docker): set CGO_ENABLED=1
Browse files Browse the repository at this point in the history
  • Loading branch information
ngshiheng committed Feb 3, 2024
1 parent fc89a1c commit 0c510bf
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Build stage
FROM golang:1.21-alpine AS go-builder
RUN apk update
RUN apk add --no-cache ca-certificates
RUN apk add --update gcc musl-dev
RUN update-ca-certificates

RUN apk update &&
apk add --no-cache ca-certificates gcc musl-dev &&
update-ca-certificates

WORKDIR $GOPATH/src/github.com/ngshiheng/michelin-my-maps
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN go build -o /bin/mym ./cmd/mym
RUN CGO_ENABLED=1 go build -o /bin/mym ./cmd/mym

# Final stage
FROM datasetteproject/datasette

RUN datasette install datasette-publish-vercel

COPY --from=go-builder /bin/mym /bin/mym

ARG VERCEL_TOKEN
ENV VERCEL_TOKEN=${VERCEL_TOKEN}
RUN apt-get update -yq
RUN apt-get -yq install curl gnupg ca-certificates
RUN curl -L https://deb.nodesource.com/setup_18.x | bash
RUN apt-get install -yq nodejs
RUN npm i -g vercel

RUN apk update &&
apk add --no-cache curl gnupg nodejs &&
curl -fsSL https://deb.nodesource.com/setup_18.x | sh - &&
npm i -g vercel

COPY . .

CMD ["./docker/docker-entrypoint.sh"]

0 comments on commit 0c510bf

Please sign in to comment.