Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const nextConfig: NextConfig = {
{
key: "Content-Security-Policy",
value:
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' http://localhost:4000 https://*.ghimtech.org; frame-ancestors 'none'",
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' http://localhost:4000 https://*.ghimtech.org https://*.up.railway.app; frame-ancestors 'none'",
},
],
},
Expand Down
6 changes: 4 additions & 2 deletions infrastructure/api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ RUN pnpm --filter=@ghimtech/api deploy --prod --legacy /out

FROM node:22-alpine AS runtime
ENV NODE_ENV=production
# Patch OS packages and remove package-manager tooling (npm/corepack and their
# bundled dependencies) — the runtime needs only the node binary.
# Patch OS packages, add OpenSSL (required by the Prisma engines on Alpine),
# and remove package-manager tooling (npm/corepack and their bundled
# dependencies) — the runtime needs only the node binary.
RUN apk upgrade --no-cache \
&& apk add --no-cache openssl \
&& rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /opt/yarn* \
&& addgroup -S ghimtech && adduser -S ghimtech -G ghimtech
WORKDIR /app
Expand Down
13 changes: 13 additions & 0 deletions infrastructure/railway.web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://railway.com/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "infrastructure/web.Dockerfile"
},
"deploy": {
"healthcheckPath": "/sign-in",
"healthcheckTimeout": 120,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 5
}
}
4 changes: 4 additions & 0 deletions infrastructure/web.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ RUN corepack enable pnpm
WORKDIR /app

FROM base AS build
# The API origin is baked into the client bundle at build time; Railway (and
# other CI) pass it through as a build argument.
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json turbo.json tsconfig.base.json ./
COPY packages ./packages
COPY apps/web ./apps/web
Expand Down
Loading