AstraOS commited on
Commit
0f22f9c
·
verified ·
1 Parent(s): 987ef9f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -15,16 +15,13 @@ ENV PATH="${NVM_DIR}/versions/node/$(ls ${NVM_DIR}/versions/node)/bin:$PATH"
15
  RUN mkdir -p $NVM_DIR && \
16
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
17
 
18
- # Ensure NVM is always loaded
19
- RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
20
- echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> ~/.bashrc && \
21
- echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' >> ~/.bashrc
22
 
23
- # Install Node.js using NVM
24
- RUN bash -c "source ~/.bashrc && nvm install node && nvm use node"
25
-
26
- # Ensure Node.js is available globally
27
- RUN bash -c "source ~/.bashrc && node -v && npm -v"
28
 
29
  # Set working directory
30
  WORKDIR /app
@@ -34,4 +31,4 @@ COPY . /app
34
  EXPOSE 3000 7860
35
 
36
  # Run both Node.js & Python servers
37
- CMD ["/bin/bash", "-c", "source ~/.bashrc && node server.js & uvicorn app:app --host 0.0.0.0 --port 7860"]
 
15
  RUN mkdir -p $NVM_DIR && \
16
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
17
 
18
+ # Persist NVM configuration
19
+ RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /etc/profile.d/nvm.sh && \
20
+ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> /etc/profile.d/nvm.sh && \
21
+ echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' >> /etc/profile.d/nvm.sh
22
 
23
+ # Install Node.js using NVM (in the same RUN command)
24
+ RUN bash -c "source /etc/profile.d/nvm.sh && nvm install node && nvm use node && node -v && npm -v"
 
 
 
25
 
26
  # Set working directory
27
  WORKDIR /app
 
31
  EXPOSE 3000 7860
32
 
33
  # Run both Node.js & Python servers
34
+ CMD ["/bin/bash", "-c", "source /etc/profile.d/nvm.sh && node server.js & uvicorn app:app --host 0.0.0.0 --port 7860"]