Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # NEO web client for the una-ci Railway project, deployed as service `neo` next to `una`.
  2. # .github/workflows/ci.yml uploads the `neo/` sources with this file and railway.toml
  3. # added (scripts/railway/neo/), so the build context is the NEO root.
  4. FROM node:24-slim
  5. WORKDIR /app
  6. ENV NEXT_TELEMETRY_DISABLED=1
  7. # Railway hands service variables to a Dockerfile build only as declared ARGs. The URLs are
  8. # baked into the client bundle (NEXT_PUBLIC_*) and the image allowlist, so each environment
  9. # builds its own image.
  10. ARG UNA_URL
  11. ARG NEXT_PUBLIC_UNA_URL
  12. ARG APP_URL
  13. ARG NEXT_PUBLIC_APP_URL
  14. COPY . .
  15. # yarn.lock isn't committed, so this resolves the package.json ranges like a fresh `yarn`;
  16. # Tailwind is pinned in the root `resolutions`.
  17. RUN corepack enable \
  18. && yarn install --non-interactive --network-timeout 600000 \
  19. && yarn build \
  20. && yarn cache clean
  21. ENV NODE_ENV=production
  22. WORKDIR /app/apps/next
  23. # Railway sets PORT; listen on every interface so its proxy and private network reach it.
  24. CMD ["sh", "-c", "exec node ../../node_modules/next/dist/bin/next start -H 0.0.0.0 -p ${PORT:-3000}"]