Stub web project
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,19 +1,35 @@
|
||||
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS requirements
|
||||
RUN apt-get update
|
||||
RUN apt-get update -y
|
||||
RUN apt-get upgrade -y
|
||||
RUN apt install -y python3-pip
|
||||
ENV TOKENIZERS_PARALLELISM=false
|
||||
COPY requirements.txt /requirements.txt
|
||||
RUN pip3 install -r /requirements.txt
|
||||
RUN rm -rf /requirements.txt
|
||||
|
||||
FROM requirements AS test
|
||||
FROM requirements AS sia-test
|
||||
COPY ./ /root/sia/
|
||||
WORKDIR /root/sia/
|
||||
RUN mkdir -p /root/model
|
||||
CMD ["python3", "-m", "unittest", "discover", "-v", "-p", "*test.py", "-v"]
|
||||
|
||||
FROM node:20-alpine AS web-test
|
||||
WORKDIR /app
|
||||
COPY web/package*.json ./
|
||||
RUN npm install
|
||||
COPY web .
|
||||
RUN npm test
|
||||
|
||||
FROM node:20-alpine AS web-build
|
||||
WORKDIR /app
|
||||
COPY web/package*.json ./
|
||||
RUN npm install
|
||||
COPY web .
|
||||
RUN npm run build
|
||||
|
||||
FROM requirements
|
||||
COPY ./ /root/sia/
|
||||
WORKDIR /root/sia/
|
||||
COPY --from=web-build /app/dist /root/sia/static/
|
||||
WORKDIR /root/sia
|
||||
|
||||
CMD ["python3", "-m", "sia"]
|
||||
Reference in New Issue
Block a user