Skip to content

Commit ba1aea6

Browse files
committed
initial commit
1 parent 5c9fa73 commit ba1aea6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Base image is node-22
2+
FROM node:22-slim AS base
3+
4+
# Setup pnpm
5+
ENV PNPM_HOME="/pnpm"
6+
ENV PATH="$PNPM_HOME:$PATH"
7+
RUN corepack enable
8+
RUN corepack install --global [email protected]
9+
10+
# Create app directory
11+
WORKDIR /usr/src/app
12+
13+
# install dependencies into temp directory
14+
# this will cache them and speed up future builds
15+
FROM base AS install
16+
# install python and all the stuff required to build sqlite3
17+
RUN apt-get update && apt-get install -y python3 build-essential
18+
19+
# Install dependencies
20+
RUN mkdir -p /temp/prod
21+
COPY package.json /temp/prod/
22+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd /temp/prod && pnpm install --prod
23+
24+
FROM base AS release
25+
26+
# Set env to production
27+
ENV NODE_ENV=production
28+
29+
# copy production dependencies and source code into final image
30+
COPY . .
31+
COPY --from=install /temp/prod/node_modules node_modules
32+
33+
# run the app
34+
EXPOSE 42069/tcp
35+
ENTRYPOINT [ "pnpm", "ponder", "start"]

0 commit comments

Comments
 (0)