Skip to content

Commit

Permalink
빌드 파이프라인 전체 재작성 (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
devunt committed Nov 7, 2024
1 parent 466fc3b commit 737f98b
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 135 deletions.
7 changes: 4 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.DS_Store

node_modules/
dist/
.turbo/
node_modules
dist
.turbo
.svelte-kit

.env.local

Expand Down
31 changes: 17 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
FROM oven/bun:1
WORKDIR /app
FROM oven/bun:1-slim AS builder
WORKDIR /build

ARG TURBO_TEAM
ARG TURBO_TOKEN
ENV TURBO_TEAM=${TURBO_TEAM}
ENV TURBO_TOKEN=${TURBO_TOKEN}
ENV TURBO_REMOTE_ONLY=true
ENV NODE_ENV=production

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
tini \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN bun install --frozen-lockfile --ignore-scripts
RUN bun run build

RUN curl -fsSL https://get.pulumi.com | sh
ENV PATH="/root/.pulumi/bin:$PATH"
FROM oven/bun:1-slim AS deps
WORKDIR /deps

COPY . .
RUN bun install --frozen-lockfile
RUN bun install --production

FROM oven/bun:1-slim AS runner
WORKDIR /app

ENV NODE_ENV=production
RUN bun run build

USER bun
ENTRYPOINT ["/usr/bin/tini", "--"]
COPY --from=builder /build/apps/api/dist ./apps/api
COPY --from=builder /build/apps/dashboard/dist ./apps/dashboard
COPY --from=builder /build/apps/usersite/dist ./apps/usersite
COPY --from=builder /build/apps/website/dist ./apps/website
COPY --from=deps /deps/node_modules ./node_modules
6 changes: 3 additions & 3 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@langchain/community": "^0.3.11",
"@langchain/core": "^0.3.17",
"@langchain/langgraph": "^0.2.20",
"@langchain/openai": "^0.3.11",
"@paralleldrive/cuid2": "^2.2.2",
"@portone/server-sdk": "^0.2.1",
"@pothos/core": "^4.3.0",
Expand All @@ -40,7 +39,6 @@
"@trpc/client": "^11.0.0-rc.608",
"@trpc/server": "^11.0.0-rc.608",
"async-mutex": "^0.5.0",
"cheerio": "^1.0.0",
"croner": "^8.1.2",
"dataloader": "^2.2.2",
"dayjs": "^1.11.13",
Expand All @@ -64,7 +62,6 @@
"mime-types": "^2.1.35",
"nanoid": "^5.0.8",
"postgres": "^3.4.5",
"puppeteer": "^23.7.0",
"remeda": "^2.16.0",
"rfc4648": "^1.5.3",
"satori": "^0.11.3",
Expand All @@ -85,8 +82,11 @@
"@types/mime-types": "^2.1.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"cheerio": "^1.0.0",
"drizzle-kit": "^0.27.1",
"puppeteer": "^23.7.0",
"react-email": "^3.0.2",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/api/pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const site = new readable.Site('api', {
image: {
name: '637423633734.dkr.ecr.ap-northeast-2.amazonaws.com/readable',
digest: config.require('digest'),
command: ['bun', 'run', 'apps/api/src/main.ts'],
command: ['bun', 'run', 'apps/api/index.js'],
},

resources: {
Expand Down
15 changes: 15 additions & 0 deletions apps/api/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'tsup';

export default defineConfig({
clean: true,

entry: { index: 'src/main.ts' },
outDir: 'dist',

format: 'esm',
esbuildOptions: (options) => {
options.chunkNames = 'chunks/[name]-[hash]';
},

noExternal: [/^@readable\//],
});
34 changes: 16 additions & 18 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,38 @@
"dev": "doppler run -- vite dev",
"lint:svelte": "svelte-check --fail-on-warnings"
},
"dependencies": {
"@readable/gql": "workspace:*",
"@readable/lib": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/ui": "workspace:*",
"dayjs": "^1.11.13",
"fast-diff": "^1.3.0",
"ky": "^1.7.2",
"mixpanel-browser": "^2.55.1",
"nanoid": "^5.0.8",
"query-string": "^9.1.1",
"rfc4648": "^1.5.3",
"y-indexeddb": "^9.0.12",
"y-protocols": "^1.0.6",
"yjs": "^13.6.20",
"zod": "^3.23.8"
},
"devDependencies": {
"@iconify-json/lucide": "^1.2.11",
"@iconify-json/simple-icons": "^1.2.11",
"@pandacss/dev": "^0.47.0",
"@pulumi/pulumi": "^3.137.0",
"@readable/adapter-bun": "workspace:*",
"@readable/gql": "workspace:*",
"@readable/lib": "workspace:*",
"@readable/pulumi": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/tsconfig": "workspace:*",
"@readable/ui": "workspace:*",
"@sveltejs/kit": "^2.7.5",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/mixpanel-browser": "^2.50.2",
"dayjs": "^1.11.13",
"fast-diff": "^1.3.0",
"ky": "^1.7.2",
"mixpanel-browser": "^2.55.1",
"nanoid": "^5.0.8",
"query-string": "^9.1.1",
"rfc4648": "^1.5.3",
"svelte": "^5.1.9",
"svelte-check": "^4.0.5",
"svelte-preprocess": "^6.0.3",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"unplugin-icons": "^0.20.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"y-indexeddb": "^9.0.12",
"y-protocols": "^1.0.6",
"yjs": "^13.6.20",
"zod": "^3.23.8"
}
}
2 changes: 1 addition & 1 deletion apps/dashboard/pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const site = new readable.Site('dashboard', {
image: {
name: '637423633734.dkr.ecr.ap-northeast-2.amazonaws.com/readable',
digest: config.require('digest'),
command: ['bun', 'run', 'apps/dashboard/dist/index.js'],
command: ['bun', 'run', 'apps/dashboard/index.js'],
},

resources: {
Expand Down
4 changes: 1 addition & 3 deletions apps/infrastructure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
"scripts": {
"lint:typecheck": "tsc"
},
"dependencies": {
"@readable/pulumi": "workspace:*"
},
"devDependencies": {
"@pulumi/aws": "^6.57.0",
"@pulumi/kubernetes": "^4.18.3",
"@pulumi/pulumi": "^3.137.0",
"@pulumi/random": "^4.16.7",
"@pulumi/tailscale": "^0.17.4",
"@pulumi/tls": "^5.0.9",
"@readable/pulumi": "workspace:*",
"@readable/tsconfig": "workspace:*",
"fast-glob": "^3.3.2",
"tsx": "^4.19.2"
Expand Down
6 changes: 2 additions & 4 deletions apps/literoom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
"build:layers": "bun scripts/build-layers.ts",
"lint:typecheck": "tsc"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.685.0",
"sharp": "^0.33.5"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.685.0",
"@pulumi/aws": "^6.57.0",
"@pulumi/pulumi": "^3.137.0",
"@readable/tsconfig": "workspace:*",
"sharp": "^0.33.5",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
Expand Down
28 changes: 13 additions & 15 deletions apps/usersite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,33 @@
"dev": "doppler run -- vite dev",
"lint:svelte": "svelte-check --fail-on-warnings"
},
"dependencies": {
"@fingerprintjs/fingerprintjs": "^4.5.1",
"@readable/gql": "workspace:*",
"@readable/lib": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/ui": "workspace:*",
"dayjs": "^1.11.13",
"nanoid": "^5.0.8",
"query-string": "^9.1.1",
"remeda": "^2.16.0",
"svelte-gestures": "^5.0.6",
"svelte-markdown": "^0.4.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@fingerprintjs/fingerprintjs": "^4.5.1",
"@iconify-json/lucide": "^1.2.11",
"@pandacss/dev": "^0.47.0",
"@pulumi/pulumi": "^3.137.0",
"@readable/adapter-bun": "workspace:*",
"@readable/gql": "workspace:*",
"@readable/lib": "workspace:*",
"@readable/pulumi": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/tsconfig": "workspace:*",
"@readable/ui": "workspace:*",
"@sveltejs/kit": "^2.7.5",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"dayjs": "^1.11.13",
"nanoid": "^5.0.8",
"query-string": "^9.1.1",
"remeda": "^2.16.0",
"svelte": "^5.1.9",
"svelte-check": "^4.0.5",
"svelte-gestures": "^5.0.6",
"svelte-markdown": "^0.4.1",
"svelte-preprocess": "^6.0.3",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"unplugin-icons": "^0.20.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"zod": "^3.23.8"
}
}
2 changes: 1 addition & 1 deletion apps/usersite/pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const site = new readable.Site('usersite', {
image: {
name: '637423633734.dkr.ecr.ap-northeast-2.amazonaws.com/readable',
digest: config.require('digest'),
command: ['bun', 'run', 'apps/usersite/dist/index.js'],
command: ['bun', 'run', 'apps/usersite/index.js'],
},

resources: {
Expand Down
12 changes: 5 additions & 7 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
"dev": "doppler run -- vite dev",
"lint:svelte": "svelte-check --fail-on-warnings"
},
"dependencies": {
"@readable/lib": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/ui": "workspace:*",
"@supabase/supabase-js": "^2.46.1",
"query-string": "^9.1.1"
},
"devDependencies": {
"@iconify-json/lucide": "^1.2.11",
"@pandacss/dev": "^0.47.0",
"@pulumi/pulumi": "^3.137.0",
"@readable/adapter-bun": "workspace:*",
"@readable/lib": "workspace:*",
"@readable/pulumi": "workspace:*",
"@readable/styled-system": "workspace:*",
"@readable/tsconfig": "workspace:*",
"@readable/ui": "workspace:*",
"@supabase/supabase-js": "^2.46.1",
"@sveltejs/kit": "^2.7.5",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"query-string": "^9.1.1",
"svelte": "^5.1.9",
"svelte-check": "^4.0.5",
"svelte-preprocess": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const site = new readable.Site('website', {
image: {
name: '637423633734.dkr.ecr.ap-northeast-2.amazonaws.com/readable',
digest: config.require('digest'),
command: ['bun', 'run', 'apps/website/dist/index.js'],
command: ['bun', 'run', 'apps/website/index.js'],
},

resources: {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
7 changes: 3 additions & 4 deletions packages/adapter-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
"scripts": {
"lint:typecheck": "tsc"
},
"dependencies": {
"@readable/lib": "workspace:*",
"hono": "^4.6.9"
},
"devDependencies": {
"@readable/lib": "workspace:*",
"@readable/tsconfig": "workspace:*",
"@sveltejs/kit": "^2.7.5",
"@types/bun": "^1.1.13",
"hono": "^4.6.9",
"tsup": "^8.3.5",
"typescript": "^5.6.3"
}
}
Loading

0 comments on commit 737f98b

Please sign in to comment.