-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d25ab4
commit fff3efd
Showing
5 changed files
with
43 additions
and
8,848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,11 @@ | |
node_modules/ | ||
.ponder/ | ||
|
||
# Some git or prebuild stuff | ||
.git | ||
.gitignore | ||
*.md | ||
dist | ||
|
||
# sst | ||
.sst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,32 @@ | ||
# use the official Bun image | ||
# see all versions at https://hub.docker.com/r/oven/bun/tags | ||
FROM node:22-slim AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# Install pnpm | ||
RUN corepack enable pnpm | ||
FROM oven/bun:1-debian as base | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
|
||
# 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 | ||
RUN apt-get install -y \ | ||
python3 \ | ||
make \ | ||
gcc \ | ||
g++ | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the app | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
# Remove some stuff | ||
RUN rm -rf node_modules/ | ||
RUN rm -rf .ponder/ | ||
|
||
# Delete package.json, since dependencies could be different in the AWS env | ||
RUN rm -rf package-lock.yaml | ||
build-essential | ||
# Install dependencies | ||
RUN mkdir -p /temp/dev | ||
COPY package.json bun.lockb /temp/dev/ | ||
RUN cd /temp/dev && bun install --frozen-lockfile --ignore-scripts | ||
|
||
# Run the prod install | ||
RUN pnpm install | ||
# install with --production (exclude devDependencies) | ||
RUN mkdir -p /temp/prod | ||
COPY package.json bun.lockb /temp/prod/ | ||
RUN cd /temp/prod && bun install --frozen-lockfile --production --ignore-scripts | ||
|
||
# Run the code generation step | ||
# todo: Normally it should be done on the dev side before pushing | ||
#FROM base AS build | ||
#RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
#RUN pnpm run codegen | ||
# copy production dependencies and source code into final image | ||
FROM base AS release | ||
COPY --from=install /temp/prod/node_modules node_modules | ||
|
||
# run the app | ||
USER bun | ||
EXPOSE 42069/tcp | ||
ENTRYPOINT [ "pnpm", "run", "start" ] | ||
ENTRYPOINT [ "bun", "run", "start" ] |
Oops, something went wrong.