Sayed121 commited on
Commit
fd18c0e
·
verified ·
1 Parent(s): c2a1583

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -2
Dockerfile CHANGED
@@ -55,10 +55,10 @@ COPY --chown=user . $HOME/app
55
 
56
  # Mount the secret and set it as an environment variable
57
  RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
58
- bash -c 'export OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY) && echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> /etc/environment'
59
 
60
  # Make port 7860 available to the world outside this container
61
  EXPOSE 7860
62
 
63
  # Run app.py when the container launches
64
- CMD ["bash", "-c", "source /etc/environment && python3 -m streamlit run app.py --server.port=7860 --server.address=0.0.0.0 --server.enableXsrfProtection=false"]
 
55
 
56
  # Mount the secret and set it as an environment variable
57
  RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
58
+ bash -c 'cat /run/secrets/OPENAI_API_KEY > /tmp/OPENAI_API_KEY && echo "export OPENAI_API_KEY=$(cat /tmp/OPENAI_API_KEY)" >> ~/.bashrc'
59
 
60
  # Make port 7860 available to the world outside this container
61
  EXPOSE 7860
62
 
63
  # Run app.py when the container launches
64
+ CMD ["bash", "-c", "source ~/.bashrc && python3 -m streamlit run app.py --server.port=7860 --server.address=0.0.0.0 --server.enableXsrfProtection=false"]