| # Use the official SQLite Web image as the base image | |
| FROM ghcr.io/coleifer/sqlite-web:latest | |
| # Set environment variables | |
| ENV STORAGE_DIR="/data/storage" | |
| ENV SERVER_PORT=7860 | |
| ENV SQLITE_DATABASE="${STORAGE_DIR}/db_filename.db" | |
| # Expose the server port | |
| EXPOSE ${SERVER_PORT} | |
| # Set the working directory | |
| WORKDIR /data | |
| # Create the storage directory and set permissions | |
| RUN mkdir -p ${STORAGE_DIR} && chmod -R 777 ${STORAGE_DIR} | |
| # Command to run SQLite Web | |
| CMD ["sqlite_web", "--host=0.0.0.0", "--port=${SERVER_PORT}", "--database=${SQLITE_DATABASE}"] | |