-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 795 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use an official Node.js LTS image
FROM node:18-alpine
# Set the working directory for the backend service
WORKDIR /app/apps/backend
# Copy root package.json and pnpm-lock.yaml to install monorepo dependencies
COPY package.json pnpm-lock.yaml /app/
# Copy backend-specific package.json and pnpm-lock.yaml
COPY apps/backend/package.json apps/backend/pnpm-lock.yaml ./
# Install dependencies using pnpm
RUN npm install -g pnpm && pnpm install --frozen-lockfile
# Copy the entire monorepo
COPY . /app
# Build the backend service
RUN pnpm --filter backend run build
# Expose port 8000
EXPOSE 9000
# Set environment variables (Railway will override these in production)
ENV PORT=9000
ENV DATABASE_URL=${DATABASE_URL}
# Start the backend service
CMD ["pnpm", "--filter", "backend", "start"]