-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (33 loc) · 1.04 KB
/
Dockerfile
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
# Use an official Python runtime as a base image
FROM python:3.11
# Install Node.js
RUN apt-get update && \
apt-get install -y curl gnupg && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy backend files
COPY elysia/ ./elysia/
# Copy frontend files
COPY frontend/ ./frontend/
COPY setup.py ./
COPY requirements.txt ./
# Copy env file if it exists at root level
COPY .env* ./
# Install backend dependencies
RUN pip install --no-cache-dir --prefer-binary '.'
RUN pip install "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.0/en_core_web_sm-3.7.0.tar.gz#egg=en_core_web_sm"
# Install frontend dependencies and build
RUN cd frontend && \
npm install && \
npm run build
# Expose the port 3000 to the outside
EXPOSE 3000
# Copy the start script
COPY start_docker.sh /start_docker.sh
RUN chmod +x /start_docker.sh
# Start both servers
CMD ["/start_docker.sh"]