Skip to content

Commit

Permalink
Merge pull request #144 from codebanesr/fix/prebuilt_images
Browse files Browse the repository at this point in the history
Adding prebuilt images instead of rebuilding everytime
  • Loading branch information
codebanesr authored Aug 20, 2023
2 parents 59d9ab7 + 73d6484 commit d5dd57e
Show file tree
Hide file tree
Showing 7 changed files with 504 additions and 1,675 deletions.
32 changes: 16 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ version: '3'
services:
backend-server:
restart: unless-stopped
build:
context: ./backend-server
dockerfile: Dockerfile
image: codebanesr/openchat_backend_server:latest
ports:
- "8000:8000"
depends_on:
Expand All @@ -18,29 +16,31 @@ services:
- DB_DATABASE=openchat
- DB_USERNAME=dbuser
- DB_PASSWORD=dbpass
env_file:
- ./common.env
volumes:
- shared_data:/app/shared_data
networks:
- openchat_network

adminer:
image: adminer
ports:
- "8080:8080"
environment:
ADMINER_DEFAULT_SERVER: db # Change this to match your database server name
depends_on:
- mysql
networks:
- openchat_network
# adminer:
# image: adminer
# ports:
# - "8080:8080"
# environment:
# ADMINER_DEFAULT_SERVER: db # Change this to match your database server name
# depends_on:
# - mysql
# networks:
# - openchat_network

llm-server:
restart: unless-stopped
build:
context: ./llm-server
dockerfile: Dockerfile
image: codebanesr/openchat_llm_server:edge
volumes:
- shared_data:/app/shared_data
env_file:
- ./common.env
networks:
- openchat_network

Expand Down
11 changes: 11 additions & 0 deletions docs/docker_push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
docker login -u codebanesr

<!-- llm-server -->
docker build -t codebanesr/openchat_llm_server:tagname .
docker push codebanesr/openchat_llm_server:tagname


<!-- backend server -->
docker build -t codebanesr/openchat_backend_server:latest .

docker push codebanesr/openchat_backend_server:latest
11 changes: 11 additions & 0 deletions llm-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
npm-debug.log
yarn-error.log
dist
Dockerfile*
docker-compose*
README.md
.git
.gitignore
.vscode
.env
39 changes: 16 additions & 23 deletions llm-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
# Use an official Node.js runtime as the base image
FROM node:18
FROM node:18-alpine as builder
WORKDIR /my-space

# Set the working directory
WORKDIR /usr/src/app

# Copy package.json and yarn.lock
COPY package*.json yarn.lock ./

COPY .env .env

# Install dependencies
COPY package.json yarn.lock ./
RUN yarn install

# Copy the project files to the container
COPY . .

# Expose the container's port (if required by the app)

# Start the app
CMD [ "npm", "run", "dev" ]





RUN npm run build

FROM node:18-alpine as runner
WORKDIR /my-space
COPY --from=builder /my-space/package.json .
COPY --from=builder /my-space/package-lock.json .
COPY --from=builder /my-space/next.config.js ./
# COPY --from=builder /my-space/public ./public
COPY --from=builder /my-space/.next/standalone ./
COPY --from=builder /my-space/.next/static ./.next/static

EXPOSE 3000
CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions llm-server/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
output: 'standalone',
webpack(config) {
config.experiments = { ...config.experiments, topLevelAwait: true };
return config;
Expand Down
4 changes: 0 additions & 4 deletions llm-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@
"ingest": "tsx -r dotenv/config scripts/ingest-data.ts"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.332.0",
"@microsoft/fetch-event-source": "^2.0.1",
"@pinecone-database/pinecone": "0.0.12",
"@qdrant/js-client-rest": "^1.3.0",
"@radix-ui/react-accordion": "^1.1.1",
"axios": "^1.4.0",
"clsx": "^1.2.1",
"dotenv": "^16.0.3",
"ignore": "^5.2.4",
"langchain": "^0.0.110",
"lucide-react": "^0.125.0",
"next": "13.2.3",
"pdf-parse": "1.1.1",
"react": "18.2.0",
Expand Down
Loading

0 comments on commit d5dd57e

Please sign in to comment.