Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions .eslintrc.cjs

This file was deleted.

19 changes: 12 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 📥 Install pnpm
uses: pnpm/action-setup@v4

- name: 🛠️ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: 📥 Download deps
uses: bahmutov/npm-install@v1

- name: 🔬 ESLint
run: npm run lint
run: pnpm install

- name: 💄 Prettier
run: npm run format:check
run: pnpm format:check

playwright:
name: 🎭 Playwright
Expand All @@ -57,19 +58,23 @@ jobs:
- name: 🏄 Copy test env vars
run: cp .env.example .env

- name: 📥 Install pnpm
uses: pnpm/action-setup@v4

- name: 🛠️ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
run: pnpm install

- name: 📥 Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: 🏗 Build
run: npm run build
run: pnpm build

- name: 🎭 Playwright tests
run: npx playwright test
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ node_modules
/playwright-report/
/playwright/.cache/

package-lock.json
pnpm-lock.yaml
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors",
"bradlc.vscode-tailwindcss",
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ This repository is a single application containing both the server and client.
### System requirements

- Node.js >= 20.0.0
- npm >= 8.18.0
- git >= 2.38.0

### Run Redis on Docker
Expand Down Expand Up @@ -66,7 +65,7 @@ git checkout -b my-new-branch
### Install dependencies

```sh
npm install
pnpm install
```

### Create .env file
Expand All @@ -80,7 +79,7 @@ You can remove the comments at the top of the new file.
### Start dev server

```sh
npm run dev
pnpm dev
```

http://localhost:3000/
Expand Down Expand Up @@ -122,7 +121,7 @@ npx playwright install
```

```sh
npm run test:e2e
pnpm test:e2e
```

Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests.
38 changes: 13 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
# base node image
FROM node:20-bookworm-slim as base
FROM node:20-bookworm-slim AS base

# set for base and all layer that inherit from it
ENV NODE_ENV production
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# Install all node_modules, including dev dependencies
FROM base as deps

WORKDIR /myapp
RUN corepack enable

ADD package.json package-lock.json ./
RUN npm install --include=dev

# Setup production node_modules
FROM base as production-deps
COPY . /myapp

WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules
ADD package.json package-lock.json ./
RUN npm prune --omit=dev
# Setup production node_modules
FROM base AS prod-deps

# Build the app
FROM base as build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

WORKDIR /myapp
# Install all node_modules, including dev dependencies
FROM base AS build

COPY --from=deps /myapp/node_modules /myapp/node_modules
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

ADD . .
RUN npm run build
RUN pnpm build

# Finally, build the production image with minimal footprint
FROM base

WORKDIR /myapp

COPY --from=production-deps /myapp/node_modules /myapp/node_modules

COPY --from=prod-deps /myapp/node_modules /myapp/node_modules
COPY --from=build /myapp/dist /myapp/dist

ADD . .

CMD ["npm", "run", "start"]
Loading