File size: 983 Bytes
b89b569
 
26a3c72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b89b569
 
26a3c72
ff3f7ee
b89b569
 
 
37a6803
 
 
26a3c72
37a6803
 
 
 
b89b569
 
 
 
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
FROM python:3.10-slim

# Install Node to run Motion Canvas
WORKDIR /tmp/node
RUN apt-get update && apt-get install -y nodejs npm


# without v prefix!
ARG MC_VERSION="3.17.2" 
ENV NODE_ENV=$MC_VERSION

WORKDIR /motion-canvas

RUN yes '' | npm init -y @motion-canvas@$MC_VERSION

WORKDIR /motion-canvas/my-animation
ENV MC_PROJECT_DIR=/motion-canvas/my-animation

# copy the vite.config.ts file to the project to get deterministic output filenames under dist/project.js
COPY docker/vite.config.ts ./vite.config.ts

# if we build here, we have to clean up the project every time before building a new one...
RUN npm install
RUN npm run build


# Install Gradio and copy local files
WORKDIR /app
COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .

RUN mkdir -p /app/public

RUN useradd -m -u 1000 user

RUN chown -R user:user /motion-canvas
RUN chown -R user:user /app
USER user


EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"

CMD ["python", "app.py"]