AstraOS commited on
Commit
7684b00
·
verified ·
1 Parent(s): eb371f4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -19,20 +19,18 @@ COPY --chown=user . /app
19
 
20
  # Stage 2: Install the latest Node.js & npm via nvm
21
  FROM python:3.11-slim-bullseye AS final
22
- WORKDIR /app
23
 
24
  # Install required dependencies
25
  RUN apt-get update && apt-get install -y curl bash git && rm -rf /var/lib/apt/lists/*
26
 
27
- # Install nvm and the latest Node.js
28
  RUN curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && \
29
- export NVM_DIR="$HOME/.nvm" && \
30
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
31
  nvm install node && \
32
- nvm use node && \
33
- node -v && npm -v
34
 
35
- # Ensure Node.js is available in PATH
36
  ENV NVM_DIR="/root/.nvm"
37
  ENV PATH="/root/.nvm/versions/node/$(ls /root/.nvm/versions/node)/bin:$PATH"
38
 
@@ -43,11 +41,11 @@ WORKDIR /app
43
  # Ensure Uvicorn is installed
44
  RUN pip install --no-cache-dir uvicorn
45
 
 
 
 
46
  # Expose necessary ports
47
  EXPOSE 3000 7860
48
 
49
- # Verify Node.js and Python environments before running
50
- RUN node -v && npm -v && python --version && pip --version && ls -l /app
51
-
52
  # Run both services
53
  CMD ["/bin/bash", "-c", "node server.js & uvicorn app:app --host 0.0.0.0 --port 7860"]
 
19
 
20
  # Stage 2: Install the latest Node.js & npm via nvm
21
  FROM python:3.11-slim-bullseye AS final
 
22
 
23
  # Install required dependencies
24
  RUN apt-get update && apt-get install -y curl bash git && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Install NVM and Node.js
27
  RUN curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && \
28
+ export NVM_DIR="/root/.nvm" && \
29
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
30
  nvm install node && \
31
+ nvm use node
 
32
 
33
+ # Ensure Node.js is accessible in $PATH
34
  ENV NVM_DIR="/root/.nvm"
35
  ENV PATH="/root/.nvm/versions/node/$(ls /root/.nvm/versions/node)/bin:$PATH"
36
 
 
41
  # Ensure Uvicorn is installed
42
  RUN pip install --no-cache-dir uvicorn
43
 
44
+ # Debugging: Verify installation
45
+ RUN node -v && npm -v && python --version && pip --version && ls -l /app
46
+
47
  # Expose necessary ports
48
  EXPOSE 3000 7860
49
 
 
 
 
50
  # Run both services
51
  CMD ["/bin/bash", "-c", "node server.js & uvicorn app:app --host 0.0.0.0 --port 7860"]