Update Dockerfile
Browse files- Dockerfile +26 -9
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# syntax=docker/dockerfile:1
|
| 2 |
# Initialize device type args
|
| 3 |
-
# use build args in the docker build
|
| 4 |
ARG USE_CUDA=false
|
| 5 |
ARG USE_OLLAMA=false
|
| 6 |
# Tested with cu117 for CUDA 11 and cu121 for CUDA 12 (default)
|
|
@@ -52,15 +52,15 @@ ENV ENV=prod \
|
|
| 52 |
USE_RERANKING_MODEL_DOCKER=${USE_RERANKING_MODEL}
|
| 53 |
|
| 54 |
## Basis URL Config ##
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
## API Key and Security Config ##
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
|
| 65 |
ENV SCARF_NO_ANALYTICS=true \
|
| 66 |
DO_NOT_TRACK=true \
|
|
@@ -152,6 +152,23 @@ COPY --chown=$UID:$GID --from=build /app/package.json /app/package.json
|
|
| 152 |
|
| 153 |
# copy backend files
|
| 154 |
COPY --chown=$UID:$GID --from=build /app/backend ./
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
EXPOSE 8080
|
| 157 |
|
|
@@ -162,4 +179,4 @@ USER $UID:$GID
|
|
| 162 |
ARG BUILD_HASH
|
| 163 |
ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
|
| 164 |
|
| 165 |
-
CMD [ "bash", "start.sh"]
|
|
|
|
| 1 |
# syntax=docker/dockerfile:1
|
| 2 |
# Initialize device type args
|
| 3 |
+
# use build args in the docker build command with --build-arg="BUILDARG=true"
|
| 4 |
ARG USE_CUDA=false
|
| 5 |
ARG USE_OLLAMA=false
|
| 6 |
# Tested with cu117 for CUDA 11 and cu121 for CUDA 12 (default)
|
|
|
|
| 52 |
USE_RERANKING_MODEL_DOCKER=${USE_RERANKING_MODEL}
|
| 53 |
|
| 54 |
## Basis URL Config ##
|
| 55 |
+
ENV OLLAMA_BASE_URL="/ollama" \
|
| 56 |
+
OPENAI_API_BASE_URL=""
|
| 57 |
|
| 58 |
## API Key and Security Config ##
|
| 59 |
+
ENV OPENAI_API_KEY="" \
|
| 60 |
+
WEBUI_SECRET_KEY="" \
|
| 61 |
+
SCARF_NO_ANALYTICS=true \
|
| 62 |
+
DO_NOT_TRACK=true \
|
| 63 |
+
ANONYMIZED_TELEMETRY=false
|
| 64 |
|
| 65 |
ENV SCARF_NO_ANALYTICS=true \
|
| 66 |
DO_NOT_TRACK=true \
|
|
|
|
| 152 |
|
| 153 |
# copy backend files
|
| 154 |
COPY --chown=$UID:$GID --from=build /app/backend ./
|
| 155 |
+
COPY --chown=$UID:$GID start.sh ./
|
| 156 |
+
|
| 157 |
+
# Install cron and other required packages
|
| 158 |
+
RUN apt-get update && apt-get install -y cron git && rm -rf /var/lib/apt/lists/*
|
| 159 |
+
|
| 160 |
+
# Add the cron job script
|
| 161 |
+
COPY --chown=$UID:$GID cron-job.sh /app/cron-job.sh
|
| 162 |
+
RUN chmod +x /app/cron-job.sh
|
| 163 |
+
|
| 164 |
+
# Create a crontab file and add it to the cron directory
|
| 165 |
+
RUN echo "* * * * * /app/cron-job.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/webui-cron
|
| 166 |
+
|
| 167 |
+
# Give execution rights on the cron job
|
| 168 |
+
RUN chmod 0644 /etc/cron.d/webui-cron
|
| 169 |
+
|
| 170 |
+
# Apply the cron job
|
| 171 |
+
RUN crontab /etc/cron.d/webui-cron
|
| 172 |
|
| 173 |
EXPOSE 8080
|
| 174 |
|
|
|
|
| 179 |
ARG BUILD_HASH
|
| 180 |
ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
|
| 181 |
|
| 182 |
+
CMD [ "bash", "start.sh"]
|