-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add dockerfile/docker-compose files
- Loading branch information
Showing
6 changed files
with
46 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.git | ||
.devbox | ||
node_modules | ||
backend/node_modules | ||
frontend |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ARG NODE_VERSION=20 | ||
|
||
FROM node:${NODE_VERSION}-slim AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
FROM base as build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm run --filter backend build | ||
|
||
FROM base | ||
ENV NODE_ENV production | ||
COPY --from=prod-deps /app/node_modules node_modules | ||
COPY --from=prod-deps /app/package*.json . | ||
COPY --from=prod-deps /app/backend/node_modules ./backend/node_modules | ||
COPY --from=prod-deps /app/backend/package*.json ./backend | ||
COPY --from=build /app/backend/dist ./backend/dist | ||
|
||
CMD ["node", "backend/dist/main.js"] |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
ports: | ||
- '3000:3000' | ||
env_file: | ||
- ./backend/.env |