Patrick Rathje
commited on
Commit
·
172cc5e
1
Parent(s):
d0d835d
clean up
Browse files- Dockerfile +0 -17
- extract_examples.py +0 -23
Dockerfile
CHANGED
|
@@ -24,20 +24,6 @@ COPY docker/vite.config.ts ./vite.config.ts
|
|
| 24 |
RUN npm install
|
| 25 |
RUN npm run build
|
| 26 |
|
| 27 |
-
# clone examples
|
| 28 |
-
#ENV MC_EXAMPLE_PROJECTS_DIR=/motion-canvas/examples
|
| 29 |
-
#RUN git clone https://github.com/motion-canvas/examples /motion-canvas/example-projects
|
| 30 |
-
|
| 31 |
-
ENV MC_DIR=/motion-canvas/motion-canvas
|
| 32 |
-
ENV MC_DOCS_DIR=/motion-canvas/motion-canvas/packages/docs
|
| 33 |
-
RUN git clone https://github.com/motion-canvas/motion-canvas /motion-canvas/motion-canvas
|
| 34 |
-
|
| 35 |
-
ENV MC_EXAMPLE_SCENES_DIR=/motion-canvas/motion-canvas/packages/examples/src/scenes
|
| 36 |
-
|
| 37 |
-
# docs/docs and docs/api should be interesting resources
|
| 38 |
-
|
| 39 |
-
RUN git clone https://github.com/motion-canvas/motion-canvas.github.io /motion-canvas/docs
|
| 40 |
-
|
| 41 |
|
| 42 |
# Install Gradio and copy local files
|
| 43 |
WORKDIR /app
|
|
@@ -45,9 +31,6 @@ RUN pip install --no-cache-dir gradio[mcp] gradio_motioncanvasplayer
|
|
| 45 |
COPY . .
|
| 46 |
|
| 47 |
RUN mkdir -p /app/public
|
| 48 |
-
ENV MC_EXAMPLES_MD_FILE=/app/public/examples.md
|
| 49 |
-
RUN python extract_examples.py $MC_EXAMPLES_MD_FILE
|
| 50 |
-
|
| 51 |
|
| 52 |
RUN useradd -m -u 1000 user
|
| 53 |
|
|
|
|
| 24 |
RUN npm install
|
| 25 |
RUN npm run build
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# Install Gradio and copy local files
|
| 29 |
WORKDIR /app
|
|
|
|
| 31 |
COPY . .
|
| 32 |
|
| 33 |
RUN mkdir -p /app/public
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
RUN useradd -m -u 1000 user
|
| 36 |
|
extract_examples.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import glob
|
| 3 |
-
from pathlib import Path
|
| 4 |
-
|
| 5 |
-
assert os.environ['MC_EXAMPLE_SCENES_DIR']
|
| 6 |
-
assert os.environ['MC_EXAMPLES_MD_FILE']
|
| 7 |
-
|
| 8 |
-
with open(os.environ['MC_EXAMPLES_MD_FILE'], "w") as f:
|
| 9 |
-
|
| 10 |
-
f.write(f"# Examples for Motion Canvas Scenes in TypeScript\n")
|
| 11 |
-
|
| 12 |
-
for filepath in glob.iglob(os.environ['MC_EXAMPLE_SCENES_DIR'] + '/**/*.tsx', recursive=True):
|
| 13 |
-
name = Path(filepath).stem
|
| 14 |
-
|
| 15 |
-
f.write(f"\n\n## {name}\n")
|
| 16 |
-
|
| 17 |
-
# read the file
|
| 18 |
-
with open(filepath, 'r') as scene_file:
|
| 19 |
-
content = scene_file.read()
|
| 20 |
-
|
| 21 |
-
f.write(f"```tsx\n")
|
| 22 |
-
f.write(content)
|
| 23 |
-
f.write(f"```\n")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|