kaeizen commited on
Commit
a215f9a
·
1 Parent(s): 308a2f4

update dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -11
Dockerfile CHANGED
@@ -23,22 +23,16 @@ RUN pip install --no-cache-dir -r requirements.txt
23
  RUN pip install git+https://github.com/huggingface/transformers@8fb854cac869b42c87a7bd15d9298985c5aea96e
24
 
25
  RUN --mount=type=secret,id=SECRET_KEY,mode=0444,required=true \
26
- sh -c 'printf "SECRET_KEY=%s\n" "$(cat /run/secrets/SECRET_KEY)" > .env'
27
 
28
  RUN --mount=type=secret,id=HUGGINGFACEHUB_API_TOKEN,mode=0444,required=true \
29
  sh -c 'printf "HUGGINGFACEHUB_API_TOKEN=%s\n" "$(cat /run/secrets/HUGGINGFACEHUB_API_TOKEN)" >> .env'
30
 
31
- RUN --mount=type=secret,id=BUILD_MODE,mode=0444,required=true \
32
- sh -c 'printf "BUILD_MODE=%s\n" "$(cat /run/secrets/BUILD_MODE)" >> .env'
33
 
34
- RUN --mount=type=secret,id=DEBUG,mode=0444,required=true \
35
- sh -c 'printf "DEBUG=%s\n" "$(cat /run/secrets/DEBUG)" >> .env'
36
-
37
- RUN --mount=type=secret,id=ALLOWED_HOSTS,mode=0444,required=true \
38
- sh -c 'printf "ALLOWED_HOSTS=%s\n" "$(cat /run/secrets/ALLOWED_HOSTS)" >> .env'
39
-
40
- RUN --mount=type=secret,id=CSRF_TRUSTED_ORIGINS,mode=0444,required=true \
41
- sh -c 'printf "CSRF_TRUSTED_ORIGINS=%s\n" "$(cat /run/secrets/CSRF_TRUSTED_ORIGINS)" >> .env'
42
 
43
  # Copy the entire backend directory
44
  COPY . .
@@ -56,6 +50,7 @@ EXPOSE 7860
56
  ENV DJANGO_SETTINGS_MODULE=backend.settings
57
  ENV PYTHONUNBUFFERED=1
58
  ENV DEBUG=False
 
59
 
60
  # Run the application with uvicorn
61
  # Hugging Face Spaces will set PORT environment variable, default to 7860
 
23
  RUN pip install git+https://github.com/huggingface/transformers@8fb854cac869b42c87a7bd15d9298985c5aea96e
24
 
25
  RUN --mount=type=secret,id=SECRET_KEY,mode=0444,required=true \
26
+ ENV DEBUG="$(cat /run/secrets/SECRET_KEY)" > .env'
27
 
28
  RUN --mount=type=secret,id=HUGGINGFACEHUB_API_TOKEN,mode=0444,required=true \
29
  sh -c 'printf "HUGGINGFACEHUB_API_TOKEN=%s\n" "$(cat /run/secrets/HUGGINGFACEHUB_API_TOKEN)" >> .env'
30
 
31
+ ARG ALLOWED_HOSTS
32
+ ARG CSRF_TRUSTED_ORIGINS
33
 
34
+ RUN printf "ALLOWED_HOSTS=%s\n" "${ALLOWED_HOSTS}" >> .env
35
+ RUN printf "CSRF_TRUSTED_ORIGINS=%s\n" "${CSRF_TRUSTED_ORIGINS}" >> .env
 
 
 
 
 
 
36
 
37
  # Copy the entire backend directory
38
  COPY . .
 
50
  ENV DJANGO_SETTINGS_MODULE=backend.settings
51
  ENV PYTHONUNBUFFERED=1
52
  ENV DEBUG=False
53
+ ENV BUILD_MODE='production'
54
 
55
  # Run the application with uvicorn
56
  # Hugging Face Spaces will set PORT environment variable, default to 7860