36 lines
1004 B
Docker
36 lines
1004 B
Docker
|
|
# 1. A: Use an existing Python image
|
||
|
|
FROM python:3.12
|
||
|
|
|
||
|
|
# 1. B: Set ENV Variables
|
||
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||
|
|
ENV PYTHONUNBUFFERED=1
|
||
|
|
|
||
|
|
ENV NODE_VERSION=24.9.0
|
||
|
|
ENV NVM_DIR=/root/.nvm
|
||
|
|
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
|
||
|
|
|
||
|
|
# 2. Set the working directory inside the container
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# 3. Copy the requirements and src files
|
||
|
|
COPY requirements.txt .
|
||
|
|
COPY package.json .
|
||
|
|
COPY src/* .
|
||
|
|
|
||
|
|
# 4. A: Install the dependencies
|
||
|
|
RUN apt update
|
||
|
|
RUN apt install -y curl libgirepository1.0-dev
|
||
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
||
|
|
|
||
|
|
# 4. B: Install nvm and node
|
||
|
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
||
|
|
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
|
||
|
|
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
|
||
|
|
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
|
||
|
|
RUN node --version
|
||
|
|
RUN npm --version
|
||
|
|
RUN npm install
|
||
|
|
|
||
|
|
# 5. Expose Port and define the command used to run the app
|
||
|
|
EXPOSE 9999
|
||
|
|
CMD ["npm", "run", "start-verbose"]
|