Update Dockerfile
Browse files- Dockerfile +10 -49
Dockerfile
CHANGED
@@ -1,71 +1,34 @@
|
|
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
|
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-
|
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 |
-
|
20 |
-
with st.sidebar:
|
21 |
-
st.title("π¬ CineGen AI Ultra+"); st.libxext6 \
|
22 |
fontconfig \
|
23 |
-
imagemagick \
|
24 |
-
|
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 |
-
|
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 |
-
|
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}"
|
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
|
@@ -73,6 +36,4 @@ RUN python -m pip install --no-cache-dir -r requirements.txt
|
|
73 |
COPY --chown=appuser:appgroup . .
|
74 |
|
75 |
EXPOSE 8501
|
76 |
-
CMD ["streamlit", "run", "app.py",
|
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"]
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
|
|
3 |
ENV PYTHONUNBUFFERED=1
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
5 |
|
|
|
6 |
RUN apt-get update && \
|
7 |
+
apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
8 |
ffmpeg \
|
9 |
libsm6 \
|
10 |
+
libxext6 \
|
|
|
|
|
11 |
fontconfig \
|
12 |
+
imagemagick && \
|
13 |
+
apt-get clean && \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
rm -rf /var/lib/apt/lists/*
|
15 |
|
|
|
|
|
16 |
RUN mkdir -p /usr/local/share/fonts/truetype/mycustomfonts
|
17 |
+
COPY assets/fonts/arial.ttf /usr/local/share/fonts/truetype/mycustomfonts/arial.ttf
|
18 |
+
# Ensure 'assets/fonts/arial.ttf' exists in your repo
|
|
|
|
|
19 |
|
|
|
20 |
RUN fc-cache -f -s -v
|
21 |
|
|
|
22 |
ARG APP_USER_UID=1000
|
23 |
ARG APP_USER_GID=1000
|
24 |
RUN groupadd --gid $APP_USER_GID appgroup && \
|
25 |
+
useradd --uid $APP_USER_UID --gid appgroup --shell /bin/bash --create-home appuser
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
WORKDIR /home/appuser/app
|
28 |
COPY --chown=appuser:appgroup requirements.txt ./
|
29 |
|
30 |
USER appuser
|
31 |
+
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
|
|
|
|
|
|
32 |
|
33 |
RUN python -m pip install --no-cache-dir --upgrade pip
|
34 |
RUN python -m pip install --no-cache-dir -r requirements.txt
|
|
|
36 |
COPY --chown=appuser:appgroup . .
|
37 |
|
38 |
EXPOSE 8501
|
39 |
+
CMD ["streamlit", "run", "app.py", "--server.headless=true", "--server.port=8501", "--server.fileWatcherType=none"]
|
|
|
|