Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +1 -98
Dockerfile
CHANGED
|
@@ -1,98 +1 @@
|
|
| 1 |
-
FROM
|
| 2 |
-
|
| 3 |
-
# Arguments
|
| 4 |
-
ARG APP_HOME=/home/node/app
|
| 5 |
-
ARG PLUGINS="" # Comma-separated list of plugin git URLs
|
| 6 |
-
ARG USERNAME=""
|
| 7 |
-
ARG PASSWORD=""
|
| 8 |
-
|
| 9 |
-
# Install system dependencies
|
| 10 |
-
# Add unzip for extracting the application code
|
| 11 |
-
# Keep git for potential use by scripts or future plugin updates
|
| 12 |
-
# Add wget to download the zip file
|
| 13 |
-
# Add curl for health checks and keep-alive
|
| 14 |
-
# Add dos2unix to fix CRLF issues
|
| 15 |
-
RUN apk add --no-cache gcompat tini git unzip wget curl dos2unix
|
| 16 |
-
|
| 17 |
-
# Create app directory
|
| 18 |
-
WORKDIR ${APP_HOME}
|
| 19 |
-
|
| 20 |
-
# Set NODE_ENV to production and set credentials from ARGs
|
| 21 |
-
ENV NODE_ENV=production
|
| 22 |
-
ENV APP_HOME=${APP_HOME}
|
| 23 |
-
ENV USERNAME=${USERNAME}
|
| 24 |
-
ENV PASSWORD=${PASSWORD}
|
| 25 |
-
|
| 26 |
-
# --- BEGIN: Clone SillyTavern Core from GitHub (staging branch) ---
|
| 27 |
-
RUN \
|
| 28 |
-
echo "*** Cloning SillyTavern Core from GitHub (staging branch) ***" && \
|
| 29 |
-
# Clone the specific branch into the current directory
|
| 30 |
-
git clone -b staging --depth 1 https://github.com/SillyTavern/SillyTavern.git . && \
|
| 31 |
-
echo "*** Cloning complete. ***"
|
| 32 |
-
# --- END: Clone SillyTavern Core ---
|
| 33 |
-
|
| 34 |
-
# --- BEGIN: Remove root .gitignore if exists ---
|
| 35 |
-
RUN \
|
| 36 |
-
echo "*** Attempting to remove root .gitignore if it exists ***" && \
|
| 37 |
-
rm -f .gitignore && \
|
| 38 |
-
echo "*** Root .gitignore removed (if it existed). ***"
|
| 39 |
-
# --- END: Remove root .gitignore ---
|
| 40 |
-
|
| 41 |
-
# Install base SillyTavern dependencies (package*.json should be in the cloned root)
|
| 42 |
-
RUN \
|
| 43 |
-
echo "*** Install Base npm packages ***" && \
|
| 44 |
-
if [ -f package.json ]; then \
|
| 45 |
-
# Added --force to potentially overcome file system issues in docker/overlayfs
|
| 46 |
-
npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev --force && npm cache clean --force; \
|
| 47 |
-
else \
|
| 48 |
-
echo "No package.json found in root, skipping base npm install."; \
|
| 49 |
-
fi
|
| 50 |
-
|
| 51 |
-
# Go back to the main app directory (redundant but safe)
|
| 52 |
-
WORKDIR ${APP_HOME}
|
| 53 |
-
|
| 54 |
-
# Create config directory. config.yaml will be handled at runtime by ENTRYPOINT
|
| 55 |
-
RUN mkdir -p config
|
| 56 |
-
|
| 57 |
-
# Pre-compile public libraries (build-lib.js should be in the unzipped structure)
|
| 58 |
-
RUN \
|
| 59 |
-
echo "*** Run Webpack ***" && \
|
| 60 |
-
# Check if build-lib.js exists before running
|
| 61 |
-
if [ -f "./docker/build-lib.js" ]; then \
|
| 62 |
-
node "./docker/build-lib.js"; \
|
| 63 |
-
elif [ -f "./build-lib.js" ]; then \
|
| 64 |
-
node "./build-lib.js"; \
|
| 65 |
-
else \
|
| 66 |
-
echo "build-lib.js not found, skipping Webpack build."; \
|
| 67 |
-
fi
|
| 68 |
-
|
| 69 |
-
# Cleanup unnecessary files (like the docker dir if it exists in the zip) and make entrypoint executable
|
| 70 |
-
# This block is removed as we no longer use docker-entrypoint.sh
|
| 71 |
-
# RUN \
|
| 72 |
-
# echo "*** Cleanup and Permissions ***" && \
|
| 73 |
-
# ...
|
| 74 |
-
|
| 75 |
-
# Fix potential git safe.directory issues if git commands are run later by scripts
|
| 76 |
-
RUN git config --global --add safe.directory "${APP_HOME}"
|
| 77 |
-
|
| 78 |
-
# Ensure the node user owns the application directory and its contents
|
| 79 |
-
RUN chown -R node:node ${APP_HOME}
|
| 80 |
-
|
| 81 |
-
# No longer download external health.sh
|
| 82 |
-
# RUN git clone --depth 1 https://github.com/fuwei99/docker-health.sh.git /tmp/health_repo && \
|
| 83 |
-
# cp /tmp/health_repo/health.sh ${APP_HOME}/health.sh && \
|
| 84 |
-
# rm -rf /tmp/health_repo
|
| 85 |
-
|
| 86 |
-
# Make the downloaded script executable
|
| 87 |
-
# RUN chmod +x ${APP_HOME}/health.sh
|
| 88 |
-
|
| 89 |
-
# Copy the entrypoint script from the repository
|
| 90 |
-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
| 91 |
-
|
| 92 |
-
# Make the new entrypoint executable
|
| 93 |
-
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 94 |
-
|
| 95 |
-
EXPOSE 8000
|
| 96 |
-
|
| 97 |
-
# Entrypoint: Execute the self-contained startup script
|
| 98 |
-
ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"]
|
|
|
|
| 1 |
+
FROM ghcr.io/fuwei99/sillytavern-docker:latest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|