R
Railway10mo ago
sdan

Trying to save a file

Trying to save a file in media/ where can i save files ? PermissionError: [Errno 13] Permission denied: 'media/images/4b690efb-a411-478e-bb4e-ce3ce0d0964a' ERROR:root:Manim error: Command '['manim', '-ql', '-o', '/app/media/4b690efb-a411-478e-bb4e-ce3ce0d0964a.mp4', '/app/4b690efb-a411-478e-bb4e-ce3ce0d0964a.py']' returned non-zero exit status 1. python: try: output_path = f"/app/media/{screen_name}.mp4" subprocess.run(["manim", "-ql", "-o", output_path, f"/app/{screen_name}.py"], check=True)
10 Replies
Percy
Percy10mo ago
Project ID: 4b690efb-a411-478e-bb4e-ce3ce0d0964a,4b690efb-a411-478e-bb4e-ce3ce0d0964a,4b690efb-a411-478e-bb4e-ce3ce0d0964a
Brody
Brody10mo ago
are you using a volume?
sdan
sdan10mo ago
no dont think so, i dont need to, all files are ephemeral
# Use the Manim community image as the base
FROM manimcommunity/manim:v0.10.0

# Install Flask and other dependencies
RUN pip install Flask

# Set the working directory
WORKDIR /app

# Change permissions for the working directory
RUN chmod 777 /app

# Copy your Flask app to the container
COPY . /app

# Expose the port the app runs on
EXPOSE 5000

# Command to run the application
CMD ["python", "main.py"]
# Use the Manim community image as the base
FROM manimcommunity/manim:v0.10.0

# Install Flask and other dependencies
RUN pip install Flask

# Set the working directory
WORKDIR /app

# Change permissions for the working directory
RUN chmod 777 /app

# Copy your Flask app to the container
COPY . /app

# Expose the port the app runs on
EXPOSE 5000

# Command to run the application
CMD ["python", "main.py"]
heres my dockerfile i tried to 777 the app dir but cant make folders for some reason
Brody
Brody10mo ago
are those uuid looking filenames normal?
sdan
sdan10mo ago
yeah they are fine, i guess i am running subprocess.run which might make the command not have permissions
Brody
Brody10mo ago
does a media folder even exist?
sdan
sdan10mo ago
yes just checked
Brody
Brody10mo ago
try USER 0 instead of that chmod thing?
sdan
sdan10mo ago
that worked for this temp fix thanks
Brody
Brody10mo ago
awesome!