Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
61abb376
Commit
61abb376
authored
8 months ago
by
timothycarambat
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm
parents
6e10f13e
2de6d642
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dockerignore
+3
-3
3 additions, 3 deletions
.dockerignore
docker/Dockerfile
+38
-31
38 additions, 31 deletions
docker/Dockerfile
docker/docker-compose.yml
+1
-4
1 addition, 4 deletions
docker/docker-compose.yml
with
42 additions
and
38 deletions
.dockerignore
+
3
−
3
View file @
61abb376
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
**/server/storage/*.db
**/server/storage/*.db
**/server/storage/lancedb
**/server/storage/lancedb
**/collector/hotdir/**
**/collector/hotdir/**
**/collector/v-env/**
**/collector/outputs/**
**/collector/outputs/**
**/node_modules/
**/node_modules/
**/dist/
**/dist/
...
@@ -13,6 +12,7 @@
...
@@ -13,6 +12,7 @@
**/.env
**/.env
**/.env.*
**/.env.*
**/bundleinspector.html
**/bundleinspector.html
!docker/.env.example
!frontend/.env.production
**/tmp/**
**/tmp/**
**/.log
!docker/.env.example
!frontend/.env.production
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker/Dockerfile
+
38
−
31
View file @
61abb376
...
@@ -27,7 +27,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
...
@@ -27,7 +27,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get
install
-yq
--no-install-recommends
nodejs
&&
\
apt-get
install
-yq
--no-install-recommends
nodejs
&&
\
curl
-LO
https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb
\
curl
-LO
https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb
\
&&
dpkg
-i
yarn_1.22.19_all.deb
\
&&
dpkg
-i
yarn_1.22.19_all.deb
\
&&
rm
yarn_1.22.19_all.deb
&&
rm
yarn_1.22.19_all.deb
&&
\
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
# Create a group and user with specific UID and GID
# Create a group and user with specific UID and GID
RUN
groupadd
-g
"
$ARG_GID
"
anythingllm
&&
\
RUN
groupadd
-g
"
$ARG_GID
"
anythingllm
&&
\
...
@@ -85,7 +87,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
...
@@ -85,7 +87,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get
install
-yq
--no-install-recommends
nodejs
&&
\
apt-get
install
-yq
--no-install-recommends
nodejs
&&
\
curl
-LO
https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb
\
curl
-LO
https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb
\
&&
dpkg
-i
yarn_1.22.19_all.deb
\
&&
dpkg
-i
yarn_1.22.19_all.deb
\
&&
rm
yarn_1.22.19_all.deb
&&
rm
yarn_1.22.19_all.deb
&&
\
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
# Create a group and user with specific UID and GID
# Create a group and user with specific UID and GID
RUN
groupadd
-g
"
$ARG_GID
"
anythingllm
&&
\
RUN
groupadd
-g
"
$ARG_GID
"
anythingllm
&&
\
...
@@ -112,55 +116,57 @@ RUN echo "Running common build flow of AnythingLLM image for all architectures"
...
@@ -112,55 +116,57 @@ RUN echo "Running common build flow of AnythingLLM image for all architectures"
USER
anythingllm
USER
anythingllm
WORKDIR
/app
WORKDIR
/app
# Install frontend dependencies
# Install & Build frontend layer
FROM
build
AS
frontend-deps
FROM
build
AS
frontend-build
COPY
--chown=anythingllm:anythingllm ./frontend /app/frontend/
COPY
./frontend/package.json ./frontend/yarn.lock ./frontend/
WORKDIR
/app/frontend
WORKDIR
/app/frontend
RUN
yarn
install
--network-timeout
100000
&&
yarn cache clean
RUN
yarn
install
--network-timeout
100000
&&
yarn cache clean
RUN
yarn build
&&
\
cp
-r
dist /tmp/frontend-build
&&
\
rm
-rf
*
&&
\
cp
-r
/tmp/frontend-build dist
&&
\
rm
-rf
/tmp/frontend-build
WORKDIR
/app
WORKDIR
/app
# Install server
dependencies
# Install server
layer & build node-llama-cpp
FROM
build
AS
server-
deps
FROM
build
AS
server-
build
COPY
./server
/package.json ./server/yarn.lock .
/server/
COPY
./server
/app
/server/
WORKDIR
/app/server
WORKDIR
/app/server
RUN
yarn
install
--production
--network-timeout
100000
&&
yarn cache clean
RUN
yarn
install
--production
--network-timeout
100000
&&
yarn cache clean
WORKDIR
/app
WORKDIR
/app
# Compile Llama.cpp bindings for node-llama-cpp for this operating system.
# Compile Llama.cpp bindings for node-llama-cpp for this operating system.
# Creates appropriate bindings for the OS
USER
root
USER
root
WORKDIR
/app/server
WORKDIR
/app/server
RUN
npx
--no
node-llama-cpp download
RUN
npx
--no
node-llama-cpp download
WORKDIR
/app
WORKDIR
/app
USER
anythingllm
USER
anythingllm
# Build the frontend
# Build collector deps (this also downloads proper chrome for collector in /app/.cache so that needs to be
FROM
frontend-deps
AS
build-stage
# transferred properly in prod-build stage.
COPY
./frontend/ ./frontend/
FROM
build
AS
collector-build
WORKDIR
/app/frontend
COPY
./collector /app/collector
RUN
yarn build
&&
yarn cache clean
&&
rm
-rf
node_modules
WORKDIR
/app
# Setup the server
FROM
server-deps
AS
production-stage
COPY
--chown=anythingllm:anythingllm ./server/ ./server/
# Copy built static frontend files to the server public directory
COPY
--chown=anythingllm:anythingllm --from=build-stage /app/frontend/dist ./server/public
# Copy the collector
COPY
--chown=anythingllm:anythingllm ./collector/ ./collector/
# Install collector dependencies
WORKDIR
/app/collector
WORKDIR
/app/collector
ENV
PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public
ENV
PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public
RUN
yarn
install
--production
--network-timeout
100000
&&
yarn cache clean
RUN
yarn
install
--production
--network-timeout
100000
&&
yarn cache clean
WORKDIR
/app
# Migrate and Run Prisma against known schema
FROM
build
AS
production-build
WORKDIR
/app/server
RUN
npx prisma generate
--schema
=
./prisma/schema.prisma
&&
\
npx prisma migrate deploy
--schema
=
./prisma/schema.prisma
WORKDIR
/app
WORKDIR
/app
# Copy the server
COPY
--chown=anythingllm:anythingllm --from=server-build /app/server/ /app/server/
# Copy built static frontend files to the server public directory
COPY
--chown=anythingllm:anythingllm --from=frontend-build /app/frontend/dist /app/server/public
# Copy the collector
COPY
--chown=anythingllm:anythingllm --from=collector-build /app/collector/ /app/collector/
COPY
--chown=anythingllm:anythingllm --from=collector-build /app/.cache/puppeteer /app/.cache/puppeteer
# No longer needed? (deprecated)
# WORKDIR /app/server
# RUN npx prisma generate --schema=./prisma/schema.prisma && \
# npx prisma migrate deploy --schema=./prisma/schema.prisma
# WORKDIR /app
# Setup the environment
# Setup the environment
ENV
NODE_ENV=production
ENV
NODE_ENV=production
...
@@ -174,4 +180,5 @@ HEALTHCHECK --interval=1m --timeout=10s --start-period=1m \
...
@@ -174,4 +180,5 @@ HEALTHCHECK --interval=1m --timeout=10s --start-period=1m \
CMD /bin/bash /usr/local/bin/docker-healthcheck.sh || exit 1
CMD /bin/bash /usr/local/bin/docker-healthcheck.sh || exit 1
# Run the server
# Run the server
# CMD ["sh", "-c", "tail -f /dev/null"] # For development: keep container open
ENTRYPOINT
["/bin/bash", "/usr/local/bin/docker-entrypoint.sh"]
ENTRYPOINT
["/bin/bash", "/usr/local/bin/docker-entrypoint.sh"]
This diff is collapsed.
Click to expand it.
docker/docker-compose.yml
+
1
−
4
View file @
61abb376
version
:
"
3.9"
name
:
anythingllm
name
:
anythingllm
networks
:
networks
:
...
@@ -8,8 +6,7 @@ networks:
...
@@ -8,8 +6,7 @@ networks:
services
:
services
:
anything-llm
:
anything-llm
:
container_name
:
anything-llm
container_name
:
anythingllm
image
:
anything-llm:latest
build
:
build
:
context
:
../.
context
:
../.
dockerfile
:
./docker/Dockerfile
dockerfile
:
./docker/Dockerfile
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment