Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheese1 committed Nov 12, 2024
1 parent 5c9fa73 commit ba1aea6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Base image is node-22
FROM node:22-slim AS base

# Setup pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack install --global pnpm@9.1.3

# Create app directory
WORKDIR /usr/src/app

# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
# install python and all the stuff required to build sqlite3
RUN apt-get update && apt-get install -y python3 build-essential

# Install dependencies
RUN mkdir -p /temp/prod
COPY package.json /temp/prod/
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd /temp/prod && pnpm install --prod

FROM base AS release

# Set env to production
ENV NODE_ENV=production

# copy production dependencies and source code into final image
COPY . .
COPY --from=install /temp/prod/node_modules node_modules

# run the app
EXPOSE 42069/tcp
ENTRYPOINT [ "pnpm", "ponder", "start"]

0 comments on commit ba1aea6

Please sign in to comment.