mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-10 05:23:09 +00:00
44 lines
711 B
Text
44 lines
711 B
Text
|
|
# Likwid Frontend Dockerfile
|
||
|
|
FROM node:20-slim as builder
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Copy package files
|
||
|
|
COPY package*.json ./
|
||
|
|
|
||
|
|
# Install dependencies
|
||
|
|
RUN npm ci
|
||
|
|
|
||
|
|
# Copy source
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
# Build argument for API base URL
|
||
|
|
ARG API_BASE=http://localhost:3000
|
||
|
|
|
||
|
|
# Set environment for build
|
||
|
|
ENV PUBLIC_API_BASE=$API_BASE
|
||
|
|
|
||
|
|
# Build the application
|
||
|
|
RUN npm run build
|
||
|
|
|
||
|
|
# Runtime stage
|
||
|
|
FROM node:20-slim
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Copy built application
|
||
|
|
COPY --from=builder /app/dist ./dist
|
||
|
|
COPY --from=builder /app/node_modules ./node_modules
|
||
|
|
COPY --from=builder /app/package.json ./
|
||
|
|
|
||
|
|
# Create non-root user
|
||
|
|
RUN useradd -r -s /bin/false likwid
|
||
|
|
USER likwid
|
||
|
|
|
||
|
|
EXPOSE 4321
|
||
|
|
|
||
|
|
ENV HOST=0.0.0.0
|
||
|
|
ENV PORT=4321
|
||
|
|
|
||
|
|
CMD ["node", "./dist/server/entry.mjs"]
|