-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
50 lines (40 loc) · 1.06 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Base image with Node.js 18
FROM node:18
# Install Python and required system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
bluetooth \
bluez \
# OpenCV dependencies
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /usr/src/app
# Copy package files for Node.js
COPY package*.json ./
# Install Node.js dependencies
RUN npm install
# Copy the rest of the Node.js application
COPY . .
# Set up Python virtual environment and install dependencies
WORKDIR /usr/src/app/child
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt
# Return to app root
WORKDIR /usr/src/app
# Set Python path to use the virtual environment
ENV VIRTUAL_ENV=/usr/src/app/child/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONPATH=/usr/src/app/child
# Expose the port your app runs on
EXPOSE 8080
# Start the application
CMD ["npm", "start"]