oweme/deploy/Containerfile
agent 0217d62bf0 Make the app's port configurable with PORT (default 8080)
compose.yaml passes ${PORT:-8080} to the app, its healthcheck and the
standalone Caddy (APP_PORT in the Caddyfile). Docs note that the panel's
domain must target the same port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
2026-10-09 22:49:54 +00:00

30 lines
1,001 B
Docker

# OweMe: one image with the server (Node standard library only, no
# node_modules) and the built web client. Build context: the repo root.
FROM docker.io/library/node:24.21.0-alpine AS build
WORKDIR /src
COPY package.json package-lock.json ./
COPY packages/core/package.json packages/core/
COPY apps/web/package.json apps/web/
# --ignore-scripts: no install hooks from dependencies run during the build.
RUN npm ci --no-audit --no-fund --ignore-scripts
COPY packages/core packages/core
COPY apps/web apps/web
RUN npm run build -w apps/web
FROM docker.io/library/node:24.21.0-alpine
WORKDIR /app
ENV NODE_ENV=production \
HOST=0.0.0.0 \
PORT=8080 \
DATA_DIR=/data \
STATIC_DIR=/app/web \
TRUST_PROXY=1
COPY apps/server/src ./server
COPY --from=build /src/apps/web/dist ./web
RUN mkdir -p /data && chown node:node /data
USER node
VOLUME /data
# Default port; compose sets PORT (see compose.yaml).
EXPOSE 8080
CMD ["node", "--disable-warning=ExperimentalWarning", "server/main.ts"]