Skip to content

Commit

Permalink
Retest with pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed May 29, 2024
1 parent cf9fcbd commit d299ace
Show file tree
Hide file tree
Showing 5 changed files with 7,993 additions and 19 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: oven-sh/setup-bun@v1
- uses: pnpm/action-setup@v4

- name: "🔨 Install dependencies"
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: "👥 Configure AWS Credentials"
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -62,4 +60,4 @@ jobs:
- name: "🚀 SST Deploy"
run: |
echo "Deploying with stage: prod"
bun sst deploy --stage prod
pnpm sst deploy --stage prod
34 changes: 21 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM node:22 as base
# Base image is node-22
FROM node:22-slim as base

# Set env to production
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
# Setup pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

# Create app directory
WORKDIR /usr/src/app

# install dependencies into temp directory
# this will cache them and speed up future builds
Expand All @@ -18,20 +21,25 @@ RUN apt-get install -y \
# Install dependencies
RUN mkdir -p /temp/prod
COPY package.json /temp/prod/
RUN cd /temp/prod && npm i
RUN cd /temp/prod && pnpm --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod

FROM base AS release

# Copy files as a non-root user. The `node` user is built in the Node image.
WORKDIR /usr/src/app
RUN chown node:node ./
USER node
# 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
# Run a final codegen to have fresh generated schema and stuff
RUN pnpm run build

# Allow node user to everything in the working directory, and switch to it
RUN chown node:node ./
USER node

# run the app
EXPOSE 42069/tcp
ENTRYPOINT [ "npm", "run", "start" ]
# ENTRYPOINT [ "pnpm", "run", "start" ]
ENTRYPOINT [ "bash" ]
Binary file removed bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"engines": {
"node": ">=18.14"
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit d299ace

Please sign in to comment.