diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index db33aeb8..41b0cae7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,8 @@ "installGradle": "true", "gradleVersion": "8.7" }, - "ghcr.io/devcontainers/features/node:1": {} + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2" : {} }, "postStartCommand": ".devcontainer/postStart.sh", "postCreateCommand": ".devcontainer/postCreate.sh", diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9d043ce..9ed138c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,11 @@ on: push jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write steps: - uses: actions/checkout@v4 with: @@ -37,7 +42,35 @@ jobs: run: npm install --prefix docs && npm run build --prefix docs - name: Build dRAGon - run: gradle build -Pversion=$(gradle cV -q -Prelease.quiet) + run: gradle bootJar -Pversion=$(gradle cV -q -Prelease.quiet) + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker Meta Data + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/dragon-okinawa/dragon + tags: | + type=raw,value=${{ github.ref_name }},enable=true + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - name: Push Release if: github.ref == 'refs/heads/main' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..93d63876 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/openjdk/jdk:17-ubuntu +LABEL org.opencontainers.image.source="https://github.com/dRAGon-Okinawa/dRAGon" + +EXPOSE 1985 +EXPOSE 1984 + +RUN mkdir /data +RUN chown app:app /data +COPY backend/build/libs/backend*.jar /dragon.jar + +USER app +ENTRYPOINT ["java","-Xmx512m", "-XX:+CrashOnOutOfMemoryError","-jar","-Dspring.profiles.active=prod","/dragon.jar"] \ No newline at end of file diff --git a/docs/docs/commands/database-export.mdx b/docs/docs/commands/database-export.mdx index ad443578..273e18e5 100644 --- a/docs/docs/commands/database-export.mdx +++ b/docs/docs/commands/database-export.mdx @@ -24,6 +24,7 @@ java -jar backend.jar --command=database-export --output=/path/to/dump.json ``` ### Using Docker + ```bash docker run -v /path/to/output:/output dragon --command=database-export --output=/output/dump.json ``` diff --git a/docs/docs/getting-started.mdx b/docs/docs/getting-started.mdx index 587d151f..9c90124e 100644 --- a/docs/docs/getting-started.mdx +++ b/docs/docs/getting-started.mdx @@ -15,7 +15,11 @@ Let's discover **dRAGon in less than 5 minutes**. -### Gradle +### Docker ```shell -gradle bootRun -``` \ No newline at end of file +docker pull ghcr.io/dragon-okinawa/dragon:latest +docker run -d -p 1985:1985 -v $(pwd)/data:/data --name dragon ghcr.io/dragon-okinawa/dragon:latest +``` + +### Gradle +See [dRAGon Development Mode](/docs/contributing/launch-dragon-dev) for more information. diff --git a/docs/docs/integrations/librechat.mdx b/docs/docs/integrations/librechat.mdx index 285fabcf..87bff7eb 100644 --- a/docs/docs/integrations/librechat.mdx +++ b/docs/docs/integrations/librechat.mdx @@ -4,5 +4,8 @@ import WIPS from '../../src/components/Admonitions/_wip_section.mdx'; ## As an AI Endpoint (OpenAI compatible) +## As a LangChain.js Plugin + + ## As an OpenAPI Plugin \ No newline at end of file