forked from bloodworks-io/phlox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
43 lines (32 loc) · 1.34 KB
/
Dockerfile.dev
File metadata and controls
43 lines (32 loc) · 1.34 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
# Use an official Node.js runtime as a parent image
FROM node:23-slim
# Set the working directory
WORKDIR /usr/src/app
# Install Python and pip
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv tesseract-ocr libsqlcipher-dev parallel
# Copy package.json and package-lock.json
COPY package*.json ./
# Install Node.js dependencies
RUN npm install
# Copy the rest of the application
COPY . .
# Make the application directories
RUN mkdir -p /usr/src/app/data
RUN mkdir -p /usr/src/app/static
RUN mkdir -p /usr/src/app/temp
RUN mkdir -p /usr/src/app/build
# Create and activate a Python virtual environment, install dependencies
RUN python3 -m venv /usr/src/app/venv
RUN /bin/bash -c "source /usr/src/app/venv/bin/activate && pip install --upgrade pip && pip install --no-cache-dir -r /usr/src/app/server/requirements.txt && pip install --no-cache-dir pytest-asyncio"
# Make a shell script to initialize the database and start both React and FastAPI
RUN echo '#!/bin/bash\n\
source /usr/src/app/venv/bin/activate\n\
python /usr/src/app/server/demo/demo_db.py\n\
parallel --tag --line-buffer ::: "npm run start-react" "uvicorn server.server:app --reload --host 0.0.0.0 --port 5000"' > start.sh
# Make the script executable
RUN chmod +x start.sh
# Expose necessary ports
EXPOSE 3000
#EXPOSE 5000
# Use the script as the CMD
CMD ["./start.sh"]