-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (31 loc) · 1.06 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 parent image
FROM python:3.10-slim AS base
# Install git to handle submodules
RUN apt-get update && apt-get install -y git
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Create and activate a virtual environment
RUN python -m venv /venv
ENV PATH="/venv/bin:$PATH"
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Use an official Node.js runtime as a parent image
FROM node:18-slim AS node_base
# Install npx globally
RUN npm install -g npx --force
# Use the base image
FROM base AS final
# Set the working directory in the container
WORKDIR /app
# Copy the installed npx from the Node.js image
COPY --from=node_base /usr/local/bin/npx /usr/local/bin/npx
# Copy the rest of the application code
COPY . .
# Copy the .env file into the container
COPY .env .
# Initialize and update git submodules
RUN git submodule init && git submodule update
# Define the command to run the application
CMD ["python", "-m", "app.main"]