Update Dockerfile
Browse files- Dockerfile +53 -22
Dockerfile
CHANGED
@@ -1,47 +1,78 @@
|
|
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
# Set environment variables
|
4 |
-
ENV PYTHONUNBUFFERED=1
|
5 |
-
|
6 |
-
|
7 |
|
8 |
# Install system dependencies
|
9 |
RUN apt-get update && \
|
10 |
-
apt-
|
|
|
|
|
|
|
11 |
ffmpeg \
|
12 |
libsm6 \
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
-
|
|
|
19 |
RUN mkdir -p /usr/local/share/fonts/truetype/mycustomfonts
|
20 |
-
COPY assets/fonts/arial.ttf /usr/local/
|
|
|
|
|
|
|
|
|
|
|
21 |
RUN fc-cache -f -s -v
|
22 |
|
23 |
-
#
|
24 |
ARG APP_USER_UID=1000
|
25 |
ARG APP_USER_GID=1000
|
26 |
RUN groupadd --gid $APP_USER_GID appgroup && \
|
27 |
-
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
COPY --chown=appuser:appgroup requirements.txt ./
|
35 |
-
USER appuser
|
36 |
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
39 |
|
40 |
-
|
41 |
-
RUN
|
42 |
|
43 |
-
# Copy application code
|
44 |
COPY --chown=appuser:appgroup . .
|
45 |
|
46 |
EXPOSE 8501
|
47 |
-
CMD ["streamlit", "run", "app.py",
|
|
|
|
|
|
1 |
+
return True
|
2 |
+
else:
|
3 |
+
st.session_state.generated_visual
|
4 |
FROM python:3.10-slim
|
5 |
|
6 |
# Set environment variables
|
7 |
+
ENV PYTHONUNBUFFERED=1
|
8 |
+
ENV DEBI_paths[scene_index] = None;
|
9 |
+
logger.warning(f"Visual generation FAILED for Scene {scene_data.get('scene_number', scene_index+1)}. img_path was: {img_AN_FRONTEND=noninteractive
|
10 |
|
11 |
# Install system dependencies
|
12 |
RUN apt-get update && \
|
13 |
+
apt-getpath}")
|
14 |
+
return False
|
15 |
+
|
16 |
+
# --- UI Sidebar --- (Same as previous full "Ultra+" app.py, with corrected install -y --no-install-recommends \
|
17 |
ffmpeg \
|
18 |
libsm6 \
|
19 |
+
st.status state)
|
20 |
+
with st.sidebar:
|
21 |
+
st.title("π¬ CineGen AI Ultra+"); st.libxext6 \
|
22 |
+
fontconfig \
|
23 |
+
imagemagick \ # ADDED for better MoviePy TextClipmarkdown("### Creative Seed")
|
24 |
+
user_idea = st.text_area("Core Story Idea / Theme:", support
|
25 |
+
# For Microsoft Core Fonts (if you were using ttf-mscorefonts-installer previously)
|
26 |
+
"A lone wanderer searches for a mythical oasis in a vast, post-apocalyptic desert, haunted by mirages and mechanical scavengers.", height=120, key="user_idea_main")
|
27 |
+
genre = st # Ensure debconf-utils is installed before this part if you re-add it
|
28 |
+
# && echo "ttf.selectbox("Primary Genre:", ["Cyberpunk", "Sci-Fi", "Fantasy", "Noir", "Thriller",-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | deb "Western", "Post-Apocalyptic", "Historical Drama", "Surreal"], index=6, key="genre_conf-set-sections \
|
29 |
+
# && apt-get install -y --no-install-recommends ttfmain")
|
30 |
+
mood = st.selectbox("Overall Mood:", ["Hopeful yet Desperate", "Mysterious & Eerie-mscorefonts-installer \
|
31 |
+
&& apt-get clean && \
|
32 |
+
# fc-cache -f", "Gritty & Tense", "Epic & Awe-Inspiring", "Melancholy & Reflective", "Wh -v && # Run fc-cache after copying custom fonts
|
33 |
rm -rf /var/lib/apt/lists/*
|
34 |
|
35 |
+
imsical & Lighthearted"], index=0, key="mood_main")
|
36 |
+
num_scenes = st.slider("Number of Key Scenes:", 1, 3, 1, key="num_scenes_main")# Create directory for custom fonts and copy your font file(s)
|
37 |
RUN mkdir -p /usr/local/share/fonts/truetype/mycustomfonts
|
38 |
+
COPY assets/fonts/arial.ttf /usr/local/
|
39 |
+
creative_guidance_options = {"Standard Director": "standard", "Artistic Visionary": "more_artisticshare/fonts/truetype/mycustomfonts/arial.ttf
|
40 |
+
# If you use other fonts, COPY them here as", "Experimental Storyteller": "experimental_narrative"}
|
41 |
+
selected_creative_guidance_key = st.selectbox(" well
|
42 |
+
|
43 |
+
# Rebuild font cache AFTER copying fonts
|
44 |
RUN fc-cache -f -s -v
|
45 |
|
46 |
+
# CreateAI Creative Director Style:", options=list(creative_guidance_options.keys()), key="creative_guidance a non-root user and group
|
47 |
ARG APP_USER_UID=1000
|
48 |
ARG APP_USER_GID=1000
|
49 |
RUN groupadd --gid $APP_USER_GID appgroup && \
|
50 |
+
_select")
|
51 |
+
actual_creative_guidance = creative_guidance_options[selected_creative_guidance_key]
|
52 |
|
53 |
+
if st.button("π Generate Cinematic Treatment", type="primary", key="generate_treatment_btn", use_container_width=True):
|
54 |
+
initialize_new_project()
|
55 |
+
if not user_ useradd --uid $APP_USER_UID --gid appgroup --shell /bin/bash --create-idea.strip(): st.warning("Please provide a story idea.")
|
56 |
+
else:
|
57 |
+
with st.status("AI Director is envisioning your masterpiece...", expanded=True) as status:
|
58 |
+
try:
|
59 |
+
status.write("Phasehome appuser
|
60 |
|
61 |
+
WORKDIR /home/appuser/app
|
62 |
COPY --chown=appuser:appgroup requirements.txt ./
|
|
|
63 |
|
64 |
+
USER appuser
|
65 |
+
ENV PATH="/home/appuser/.local/bin:${PATH}" # Ensure user 1: Gemini crafting cinematic treatment... π"); logger.info("Phase 1: Cinematic Treatment Gen.")
|
66 |
+
treatment_prompt = create_cinematic_treatment_prompt(user_idea, genre, mood, num_scenes, actual_creative_guidance)
|
67 |
+
treatment_result_json = st.session_state.gemini_handler.generate_story_breakdown(treatment_prompt)
|
68 |
+
if not isinstance(treatment_result_json,'s bin is in PATH
|
69 |
|
70 |
+
RUN python -m pip install --no-cache-dir --upgrade pip
|
71 |
+
RUN python -m pip install --no-cache-dir -r requirements.txt
|
72 |
|
|
|
73 |
COPY --chown=appuser:appgroup . .
|
74 |
|
75 |
EXPOSE 8501
|
76 |
+
CMD ["streamlit", "run", "app.py", list) or not treatment_result_json: raise ValueError("Gemini returned invalid scene list for treatment.")
|
77 |
+
st.session_state.story_treatment_scenes = treatment_result_json; num_gen_scenes = len(st.session_state.story_treatment_scenes)
|
78 |
+
st.session_state.scene_dalle_prompts "--server.headless=true", "--server.port=8501", "--server.fileWatcherType=none"]
|