feat: pipeline and dockerize
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM node:24-trixie AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
# RUN apt-get update && \
|
||||
# apt-get install -y python3 build-essential
|
||||
|
||||
ENV CI=true
|
||||
ENV npm_config_build_from_source=true
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./package.json ./
|
||||
COPY ./pnpm-lock.yaml ./
|
||||
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
|
||||
FROM base AS build
|
||||
|
||||
COPY . /app
|
||||
|
||||
ENV DATABASE_URL=build.db
|
||||
|
||||
RUN pnpm run build
|
||||
|
||||
FROM base
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/build .
|
||||
|
||||
|
||||
EXPOSE 3000
|
||||
CMD [ "node", "index.js" ]
|
||||
Reference in New Issue
Block a user