Skip to content

Commit

Permalink
chore: single Dockerfile (SnailyCAD#1775)
Browse files Browse the repository at this point in the history
Co-authored-by: Dev-CasperTheGhost <[email protected]>
  • Loading branch information
casperiv0 and casperiv0 authored Sep 2, 2023
1 parent af646f6 commit 06b0936
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 184 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-builds-typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ jobs:
env:
NODE_OPTIONS: --max-old-space-size=6144

- name: Run turbo typecheck
run: pnpm turbo run typecheck

- name: Build apps
run: pnpm turbo run build --filter="{apps/**/**}"
env:
NODE_OPTIONS: --max-old-space-size=6144

- name: Run turbo typecheck
run: pnpm turbo run typecheck

- name: Run turbo test
run: pnpm turbo run test --parallel
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM node:18 as base

RUN npm install -g pnpm

RUN pnpm config set httpTimeout 1200000

WORKDIR /snailycad

COPY . ./

FROM base as deps

RUN pnpm install

FROM deps as api

ENV NODE_ENV="production"

RUN pnpm turbo run build --filter=@snailycad/api

WORKDIR /snailycad/apps/api

CMD ["pnpm", "start"]

FROM deps as client

ENV NODE_ENV="production"

RUN rm -rf /snailycad/apps/client/.next

RUN pnpm create-images-domain

RUN pnpm turbo run build --filter=@snailycad/client

WORKDIR /snailycad/apps/client

CMD ["pnpm", "start"]
18 changes: 0 additions & 18 deletions apps/api/Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"compression": "1.7.4",
"cookie": "^0.5.0",
"cookie-parser": "1.4.6",
"cors": "^2.8.5",
"date-fns": "^2.30.0",
"discord-api-types": "0.37.56",
"ejs": "^3.1.9",
Expand All @@ -86,6 +87,7 @@
"puppeteer": "^21.1.1",
"qrcode": "^1.5.3",
"sharp": "^0.32.5",
"reflect-metadata": "^0.1.13",
"socket.io": "^4.7.2",
"undici": "^5.23.0",
"use-intl": "^2.20.0",
Expand Down
18 changes: 0 additions & 18 deletions apps/client/Dockerfile

This file was deleted.

3 changes: 3 additions & 0 deletions apps/client/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
// prettier-ignore
images: { // start images
formats: ["image/avif", "image/webp"],
Expand Down
1 change: 1 addition & 0 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"@types/sortablejs": "^1.15.2",
"@types/uuid": "^9.0.3",
"autoprefixer": "^10.4.15",
"dotenv": "^16.3.1",
"postcss": "^8.4.29",
"rimraf": "^5.0.1",
"sass": "^1.66.1",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint:fix": "pnpm eslint . --ext .ts,.js,.tsx,.jsx,.mjs --fix",
"prepare": "husky install",
"bump-version": "node scripts/bump-version.mjs",
"create-images-domain": "node scripts/create-images-domain.mjs",
"postinstall": "husky install",
"typecheck": "pnpm turbo run typecheck"
},
Expand Down
157 changes: 17 additions & 140 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 06b0936

Please sign in to comment.