chore: use pnpm instead of yarn

This commit is contained in:
Steven
2023-06-15 22:11:41 +08:00
parent d08a738a57
commit 65f59571a0
3 changed files with 3054 additions and 19 deletions

View File

@ -2,25 +2,30 @@
FROM node:18.12.1-alpine3.16 AS frontend
WORKDIR /frontend-build
COPY ./web/package.json ./web/pnpm-lock.yaml ./
RUN corepack enable && pnpm i --frozen-lockfile
COPY ./web/ .
RUN yarn && yarn build
RUN pnpm build
# Build backend exec file.
FROM golang:1.19.3-alpine3.16 AS backend
WORKDIR /backend-build
RUN apk update && apk add --no-cache gcc musl-dev
COPY . .
COPY --from=frontend /frontend-build/dist ./server/dist
RUN go build -o shortify ./main.go
RUN CGO_ENABLED=0 go build -o shortify ./main.go
# Make workspace with above generated files.
FROM alpine:3.16 AS monolithic
WORKDIR /usr/local/shortify
RUN apk add --no-cache tzdata
ENV TZ="UTC"
COPY --from=backend /backend-build/shortify /usr/local/shortify/
# Directory to store the data, which can be referenced as the mounting point.