Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.
Merged
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
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
.git
.gitignore
*.md
dist
*.md
38 changes: 17 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
FROM node:22.11-bookworm-slim AS builder
FROM node:22.11-bookworm-slim AS base

# Copy source
COPY . /app

# Create app directory
WORKDIR /app

# Setup PNPM
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# Install
RUN npm install -g corepack@latest pnpm@latest
RUN corepack enable
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

# Build
RUN pnpm build

# Deploy apps
RUN pnpm deploy --filter=api --prod /prod/api
RUN pnpm deploy --filter=web --prod /prod/web
FROM base AS build
COPY . /app
WORKDIR /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

RUN pnpm run -r build

RUN pnpm deploy --filter=api --prod /prod/api && \
cp -r "$(pnpm --filter=api list --depth=-1 --parseable)/dist" /prod/api/dist
RUN pnpm deploy --filter=web --prod /prod/web && \
cp -r "$(pnpm --filter=web list --depth=-1 --parseable)/dist" /prod/web

FROM builder AS api
COPY --from=builder /prod/api /prod/api
FROM base AS api
COPY --from=build /prod/api /prod/api
WORKDIR /prod/api
RUN ls -la
EXPOSE 5000
CMD [ "pnpm", "start:prod" ]

FROM nginx:stable AS web
COPY --from=builder /prod/web /usr/share/nginx/html
FROM base AS web
COPY --from=build /prod/web /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
3 changes: 2 additions & 1 deletion deployments/api-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec:
ipFamilies:
- IPv4
ports:
- protocol: TCP
- name: http
protocol: TCP
port: 8888
targetPort: 5000
3 changes: 2 additions & 1 deletion services/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
},
"packageManager": "pnpm@9.15.4"
}