forked from CipherYuvraj/Algorithm-Visualiser-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrailway.dockerfile
More file actions
33 lines (24 loc) · 735 Bytes
/
railway.dockerfile
File metadata and controls
33 lines (24 loc) · 735 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
31
32
33
# Optimized Dockerfile for Railway deployment
FROM node:18-alpine AS frontend-build
WORKDIR /app
# Copy frontend files
COPY frontend/package*.json ./frontend/
WORKDIR /app/frontend
RUN npm ci --only=production
COPY frontend/ ./
RUN npm run build
# Python backend stage
FROM python:3.11-slim
WORKDIR /app
# Install dependencies
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY backend/ ./
COPY --from=frontend-build /app/frontend/build ./frontend/build
# Railway uses PORT environment variable
ENV ENVIRONMENT=production
EXPOSE $PORT
CMD ["sh", "-c", "python main.py"]