-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Dockerfile
- Loading branch information
Showing
5 changed files
with
56 additions
and
65 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,27 @@ | ||
FROM node:20-slim AS pnpm-base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
FROM pnpm-base AS base | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install | ||
|
||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install | ||
RUN pnpm run build | ||
|
||
FROM pnpm-base AS arex | ||
# runtime server | ||
COPY --from=build /app/arex-server/ /app/ | ||
|
||
# frontend build product | ||
COPY --from=build /app/packages/arex/dist /app/dist | ||
|
||
WORKDIR /app | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install | ||
EXPOSE 8080 | ||
CMD [ "node", "./server.js",">","./logs/app.log","2>", "./logs/error.log"] |
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,16 @@ | ||
{ | ||
"name": "arex-server", | ||
"private": true, | ||
"version": "0.6.0", | ||
"type": "module", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"express": "^4.18.2", | ||
"http-proxy-middleware": "^2.0.6", | ||
"connect-history-api-fallback": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
} | ||
} |
File renamed without changes.
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
Oops, something went wrong.