Files
pangolin/Dockerfile
iconoclast hero 68e0911866 Patch logger for ISO8601 TZ offsets and fix Docker build
- server/logger.ts: timestamps now use local TZ offset instead of Z
- Dockerfile: replaced 'npm ci --omit=dev' with 'npm install --omit=dev' to fix Alpine build failure
- References discussion: https://github.com/orgs/fosrl/discussions/1025
- Note: timestamps default to +00:00 (UTC) unless the user sets environment: TZ=<timezone> in docker-compose.yaml

Optional future improvement: include tzdata in the container for shell/date consistency.
2025-10-03 09:25:45 -04:00

48 lines
1.2 KiB
Docker

FROM node:22-alpine AS builder
WORKDIR /app
ARG BUILD=oss
ARG DATABASE=sqlite
# COPY package.json package-lock.json ./
COPY package*.json ./
RUN npm ci
COPY . .
RUN echo "export * from \"./$DATABASE\";" > server/db/index.ts
RUN echo "export const build = \"$BUILD\" as any;" > server/build.ts
RUN if [ "$DATABASE" = "pg" ]; then npx drizzle-kit generate --dialect postgresql --schema ./server/db/pg/schema.ts --out init; else npx drizzle-kit generate --dialect $DATABASE --schema ./server/db/$DATABASE/schema.ts --out init; fi
RUN npm run build:$DATABASE
RUN npm run build:cli
FROM node:22-alpine AS runner
WORKDIR /app
# Curl used for the health checks
RUN apk add --no-cache curl
# COPY package.json package-lock.json ./
COPY package*.json ./
#RUN npm ci --omit=dev && npm cache clean --force
RUN npm install --omit=dev && npm cache clean --force
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/init ./dist/init
COPY ./cli/wrapper.sh /usr/local/bin/pangctl
RUN chmod +x /usr/local/bin/pangctl ./dist/cli.mjs
COPY server/db/names.json ./dist/names.json
COPY public ./public
CMD ["npm", "run", "start"]