Initial commit
This commit is contained in:
commit
d9cff2e70c
72 changed files with 2878 additions and 0 deletions
59
packages/client/Containerfile
Normal file
59
packages/client/Containerfile
Normal file
|
@ -0,0 +1,59 @@
|
|||
# Stage 1: Builder
|
||||
# This stage installs all dependencies and builds all packages.
|
||||
FROM oven/bun:1 AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy dependency manifests
|
||||
COPY package.json bun.lock ./
|
||||
COPY tsconfig.base.json ./
|
||||
|
||||
# Copy package-specific manifests to leverage Docker cache
|
||||
COPY packages/shared/package.json packages/shared/tsconfig.json ./packages/shared/
|
||||
COPY packages/client/package.json packages/client/tsconfig.json ./packages/client/
|
||||
|
||||
# Install ALL workspace dependencies
|
||||
RUN bun install
|
||||
|
||||
# Copy source code
|
||||
COPY packages/shared ./packages/shared/
|
||||
COPY packages/client ./packages/client/
|
||||
|
||||
# Build the client and its dependencies (i.e., 'shared')
|
||||
RUN bun run --filter=@hnu.de/hl7v2-shared build
|
||||
RUN bun run --filter=@hnu.de/hl7v2-client build
|
||||
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
# Stage 2: Production
|
||||
FROM oven/bun:1-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Create the full directory structure first
|
||||
RUN mkdir -p packages/shared packages/client
|
||||
|
||||
# Copy workspace configuration
|
||||
COPY --from=builder /app/package.json /app/bun.lock ./
|
||||
|
||||
# Set up shared package with its dist directory
|
||||
COPY --from=builder /app/packages/shared/package.json ./packages/shared/
|
||||
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist
|
||||
|
||||
# Set up client package with its dist directory
|
||||
COPY --from=builder /app/packages/client/package.json ./packages/client/
|
||||
COPY --from=builder /app/packages/client/build ./packages/client/build
|
||||
|
||||
# Install ONLY production dependencies
|
||||
ENV NODE_ENV=production
|
||||
RUN bun install \
|
||||
--frozen-lockfile \
|
||||
--production
|
||||
|
||||
# Set environment variables from config.ts
|
||||
ENV PUBLIC_SERVER=localhost:8080
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Run the client from its package directory
|
||||
WORKDIR /app/packages/client
|
||||
CMD ["bun", "-r", "dotenv/config", "build/index.js"]
|
Loading…
Add table
Add a link
Reference in a new issue