This commit is contained in:
Alejandro Gil 2023-04-14 01:28:45 -07:00 committed by GitHub
commit 30a7563a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 14 deletions

27
.github/workflows/docker-image.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/build-push-action@v4
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: USER/sygil-webui:latest

View File

@ -1,27 +1,37 @@
ARG IMAGE=hlky/sd-webui:base
ARG IMAGE=USER/sd-webui:base
# Use the base image
FROM ${IMAGE}
# Set the working directory
WORKDIR /workdir
# Use the specified shell
SHELL ["/bin/bash", "-c"]
# Set environment variables
ENV PYTHONPATH=/sd
# Expose the required port
EXPOSE 8501
# Copy necessary files and directories
COPY ./entrypoint.sh /sd/
COPY ./data/DejaVuSans.ttf /usr/share/fonts/truetype/
COPY ./data/ /sd/data/
copy ./images/ /sd/images/
copy ./scripts/ /sd/scripts/
copy ./ldm/ /sd/ldm/
copy ./frontend/ /sd/frontend/
copy ./configs/ /sd/configs/
copy ./configs/webui/webui_streamlit.yaml /sd/configs/webui/userconfig_streamlit.yaml
copy ./.streamlit/ /sd/.streamlit/
copy ./optimizedSD/ /sd/optimizedSD/
ENTRYPOINT /sd/entrypoint.sh
COPY ./data /sd/data
COPY ./images /sd/images
COPY ./scripts /sd/scripts
COPY ./ldm /sd/ldm
COPY ./frontend /sd/frontend
COPY ./configs /sd/configs
COPY ./configs/webui/webui_streamlit.yaml /sd/configs/webui/userconfig_streamlit.yaml
COPY ./.streamlit /sd/.streamlit
COPY ./optimizedSD /sd/optimizedSD
RUN mkdir -p ~/.streamlit/
RUN echo "[general]" > ~/.streamlit/credentials.toml
RUN echo "email = \"\"" >> ~/.streamlit/credentials.toml
# Set the entrypoint
ENTRYPOINT ["/sd/entrypoint.sh"]
# Create .streamlit directory and set up credentials.toml
RUN mkdir -p ~/.streamlit \
&& echo "[general]" > ~/.streamlit/credentials.toml \
&& echo "email = \"\"" >> ~/.streamlit/credentials.toml