Files
kittyFE/Dockerfile
sherl f2948eeebe
Some checks failed
Build and push Docker image / build (push) Failing after 1m26s
Update changelog / changelog (push) Has been cancelled
Release new version / release (push) Has been cancelled
fix: workaround npm multi-platform build bug
rolls back build CI/CD to ARM64-only
2026-01-20 22:14:03 +01:00

31 lines
955 B
Docker

# Credit:
# https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
# https://stackoverflow.com/a/56941391
#
# Includes workaround for:
# https://github.com/expo/expo/issues/33340
# https://github.com/npm/cli/issues/4828
FROM node:24-trixie-slim AS builder
WORKDIR /app
COPY ./kittyurl-frontend/package*.json ./
RUN npm ci && npm i --force && npm cache clean --force
COPY ./kittyurl-frontend/. ./
RUN npm run build
FROM node:24-trixie-slim AS production
WORKDIR /app
RUN addgroup --gid 1001 nodejs && \
adduser --gid 1001 --uid 1001 nodejs
COPY --from=builder --chown=nodejs:nodejs /app /app
USER nodejs
EXPOSE 6568
# Since we don't know user's .env ahead of time, kittyFE needs to
# rebuild itself every launch so that the changes in .env get reflected.
# This is not ideal and we're looking into possible ways to improve this.
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "6568"]