Skip to content

Commit

Permalink
Merge pull request #22 from rti/dockerfile-lock-versions-node18
Browse files Browse the repository at this point in the history
Dockerfile lock versions node18
  • Loading branch information
rti authored Feb 4, 2024
2 parents 887f3d4 + 88fc415 commit a8448bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ frontend/dist
!package.json
!yarn.lock
!.yarnrc

53 changes: 20 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ RUN apt-get update -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*


# Install node from upstream, ubuntu packages are too old
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
RUN apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*


# Install node package manager yarn
RUN npm install -g yarn


# Install ollama llm inference engine
COPY --from=ollama /usr/bin/ollama /usr/local/ollama/bin/ollama
ENV PATH="/usr/local/ollama/bin:${PATH}"
# RUN curl https://ollama.ai/install.sh | sh

# Upgrade pip
RUN python3 -m pip install --upgrade pip

# Install fastapi and web server
RUN pip install fastapi
RUN pip install "uvicorn[standard]"

# RAG framework haystack
# RUN pip install "sentence-transformers>=2.2.0"

# Pull a language model (see LICENSE_STABLELM2.txt)
ARG MODEL=stablelm2:1.6b-zephyr
Expand All @@ -47,48 +49,33 @@ RUN ollama serve & while ! curl http://localhost:11434; do sleep 1; done; ollama
# COPY --chmod=644 Modelfile Modelfile
# RUN curl --location https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-GGUF/resolve/main/discolm_german_7b_v1.Q5_K_S.gguf?download=true --output discolm_german_7b_v1.Q5_K_S.gguf; ollama serve & while ! curl http://localhost:11434; do sleep 1; done; ollama create ${MODEL} -f Modelfile && rm -rf /tmp/model


# Setup the custom API and frontend
WORKDIR /workspace

# Install backend dependencies
COPY --chmod=755 requirements.txt requirements.txt
RUN pip install -r requirements.txt


# Install frontend dependencies
COPY --chmod=755 frontend/package.json frontend/package.json
COPY --chmod=755 frontend/yarn.lock frontend/yarn.lock
# RUN cd frontend && yarn install

# Copy and build frontend for production (into the frontend/dist folder)
COPY --chmod=755 frontend frontend
# RUN cd frontend && yarn build
RUN cd frontend && yarn install

# Copy backend for production
COPY --chmod=644 gswikichat gswikichat

# Copy data
COPY --chmod=755 json_input json_input

# Install node from upstream, ubuntu packages are too old
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

# Install node from upstream, ubuntu packages are too old
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash
RUN apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN npm cache clean -f
RUN npm install -g n
RUN n 18.17.1
# Copy backend for production
COPY --chmod=644 gswikichat gswikichat

# RUN node -v

# Install node package manager yarn
RUN npm install -g yarn
# Copy and build frontend for production (into the frontend/dist folder)
COPY --chmod=755 frontend frontend
RUN cd frontend && yarn build

# Install frontend dependencies and build it for production (into the frontend/dist folder)
RUN cd frontend && yarn install && yarn build

# Container startup script
COPY --chmod=755 start.sh /start.sh
Expand Down

0 comments on commit a8448bb

Please sign in to comment.