-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 740 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (18 loc) · 740 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
FROM node:22-slim
# Install Python for sentiment service
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Node.js dependencies
COPY package*.json ./
RUN npm ci --only=production
# Install Python dependencies (lightweight — no PyTorch in production)
COPY sentiment_service/requirements.txt ./sentiment_service/
RUN python3 -m venv /app/venv && \
/app/venv/bin/pip install --no-cache-dir -r sentiment_service/requirements.txt
# Copy application code
COPY . .
# Expose port
EXPOSE 3000
# Start script: launches both Python sentiment service and Node.js server
CMD bash -c "/app/venv/bin/python sentiment_service/app.py & sleep 2 && node app.js"