fix(docker): add env vars for host and port to the Dockerfile

This commit is contained in:
Eugene Brodsky 2024-03-20 16:36:44 -04:00
parent 3278497674
commit 35f847d5b7
2 changed files with 4 additions and 2 deletions

View File

@ -94,6 +94,8 @@ RUN apt update && apt install -y --no-install-recommends \
ENV INVOKEAI_SRC=/opt/invokeai ENV INVOKEAI_SRC=/opt/invokeai
ENV VIRTUAL_ENV=/opt/venv/invokeai ENV VIRTUAL_ENV=/opt/venv/invokeai
ENV INVOKEAI_ROOT=/invokeai ENV INVOKEAI_ROOT=/invokeai
ENV INVOKEAI_HOST=0.0.0.0
ENV INVOKEAI_PORT=9090
ENV PATH="$VIRTUAL_ENV/bin:$INVOKEAI_SRC:$PATH" ENV PATH="$VIRTUAL_ENV/bin:$INVOKEAI_SRC:$PATH"
ENV CONTAINER_UID=${CONTAINER_UID:-1000} ENV CONTAINER_UID=${CONTAINER_UID:-1000}
ENV CONTAINER_GID=${CONTAINER_GID:-1000} ENV CONTAINER_GID=${CONTAINER_GID:-1000}
@ -118,4 +120,4 @@ RUN mkdir -p ${INVOKEAI_ROOT} && chown -R ${CONTAINER_UID}:${CONTAINER_GID} ${IN
COPY docker/docker-entrypoint.sh ./ COPY docker/docker-entrypoint.sh ./
ENTRYPOINT ["/opt/invokeai/docker-entrypoint.sh"] ENTRYPOINT ["/opt/invokeai/docker-entrypoint.sh"]
CMD ["invokeai-web", "--host", "0.0.0.0"] CMD ["invokeai-web"]

View File

@ -19,7 +19,7 @@ x-invokeai: &invokeai
- INVOKEAI_ROOT=${CONTAINER_INVOKEAI_ROOT:-/invokeai} - INVOKEAI_ROOT=${CONTAINER_INVOKEAI_ROOT:-/invokeai}
- HF_HOME - HF_HOME
ports: ports:
- "${INVOKEAI_PORT:-9090}:9090" - "${INVOKEAI_PORT:-9090}:${INVOKEAI_PORT:-9090}"
volumes: volumes:
- type: bind - type: bind
source: ${HOST_INVOKEAI_ROOT:-${INVOKEAI_ROOT:-~/invokeai}} source: ${HOST_INVOKEAI_ROOT:-${INVOKEAI_ROOT:-~/invokeai}}