wip: testing leaner docker strategy and deployment compose file (#719)

* nginx setup

* chore(dev-images.yml): update workflow trigger to push events on main branch
chore(dev-images.yml): remove building and pushing of librechat-dev-client image
chore(nginx.conf): comment out SSL configuration in nginx.conf
chore(deploy-compose.yml): uncomment api build configuration in deploy-compose.yml
chore(deploy-compose.yml): update client build configuration in deploy-compose.yml
This commit is contained in:
Danny Avila 2023-07-27 18:52:10 -04:00 committed by GitHub
parent dae2805d27
commit 1f8520cdad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 11 deletions

View file

@ -1,7 +1,9 @@
name: Docker Dev Images Build name: Docker Dev Images Build
on: on:
workflow_dispatch: push:
branches:
- main
jobs: jobs:
build: build:
@ -29,7 +31,6 @@ jobs:
run: | run: |
cp .env.example .env cp .env.example .env
docker build -f Dockerfile.multi --target api-build -t librechat-dev-api . docker build -f Dockerfile.multi --target api-build -t librechat-dev-api .
docker build -f Dockerfile.multi --target prod-stage -t librechat-dev-client .
docker build -f Dockerfile -t librechat-dev . docker build -f Dockerfile -t librechat-dev .
# Tag and push the images to GitHub Container Registry # Tag and push the images to GitHub Container Registry
@ -40,11 +41,6 @@ jobs:
docker tag librechat-dev-api:latest ghcr.io/${{ github.repository_owner }}/librechat-dev-api:latest docker tag librechat-dev-api:latest ghcr.io/${{ github.repository_owner }}/librechat-dev-api:latest
docker push ghcr.io/${{ github.repository_owner }}/librechat-dev-api:latest docker push ghcr.io/${{ github.repository_owner }}/librechat-dev-api:latest
docker tag librechat-dev-client:latest ghcr.io/${{ github.repository_owner }}/librechat-dev-client:${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/librechat-dev-client:${{ github.sha }}
docker tag librechat-dev-client:latest ghcr.io/${{ github.repository_owner }}/librechat-dev-client:latest
docker push ghcr.io/${{ github.repository_owner }}/librechat-dev-client:latest
docker tag librechat-dev:latest ghcr.io/${{ github.repository_owner }}/librechat-dev:${{ github.sha }} docker tag librechat-dev:latest ghcr.io/${{ github.repository_owner }}/librechat-dev:${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/librechat-dev:${{ github.sha }} docker push ghcr.io/${{ github.repository_owner }}/librechat-dev:${{ github.sha }}
docker tag librechat-dev:latest ghcr.io/${{ github.repository_owner }}/librechat-dev:latest docker tag librechat-dev:latest ghcr.io/${{ github.repository_owner }}/librechat-dev:latest

View file

@ -28,6 +28,5 @@ CMD ["node", "server/index.js"]
# Nginx setup # Nginx setup
FROM nginx:1.21.1-alpine AS prod-stage FROM nginx:1.21.1-alpine AS prod-stage
COPY --from=client-build /app/client/dist /usr/share/nginx/html
COPY ./client/nginx.conf /etc/nginx/conf.d/default.conf COPY ./client/nginx.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View file

@ -1,5 +1,10 @@
server { server {
listen 80; listen 80;
# listen 443 ssl;
# ssl_certificate /etc/nginx/ssl/nginx.crt;
# ssl_certificate_key /etc/nginx/ssl/nginx.key;
server_name localhost; server_name localhost;
location /api { location /api {
@ -7,7 +12,6 @@ server {
} }
location / { location / {
root /usr/share/nginx/html; proxy_pass http://api:3080;
try_files $uri $uri/ /index.html;
} }
} }

View file

@ -1,6 +1,10 @@
version: "3.8" version: "3.8"
services: services:
api: api:
# build:
# context: .
# dockerfile: Dockerfile.multi
# target: api-build
image: ghcr.io/danny-avila/librechat-dev-api:latest image: ghcr.io/danny-avila/librechat-dev-api:latest
container_name: LibreChat-API container_name: LibreChat-API
ports: ports:
@ -19,7 +23,11 @@ services:
- MEILI_HOST=http://meilisearch:7700 - MEILI_HOST=http://meilisearch:7700
- MEILI_HTTP_ADDR=meilisearch:7700 - MEILI_HTTP_ADDR=meilisearch:7700
client: client:
image: ghcr.io/danny-avila/librechat-dev-client:latest build:
context: .
dockerfile: Dockerfile.multi
target: prod-stage
container_name: LibreChat-NGINX
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443