Spaces:
Running
Running
Update Dockerfile
Browse files- 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 |
-
#
|
19 |
-
RUN echo 'export NVM_DIR="$HOME/.nvm"' >>
|
20 |
-
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >>
|
21 |
-
echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' >>
|
22 |
|
23 |
-
# Install Node.js using NVM
|
24 |
-
RUN bash -c "source
|
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
|
|
|
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"]
|