improvements to docker

This commit is contained in:
daniel31x13
2025-03-19 23:47:31 -04:00
parent 0987475e41
commit 2f05dbad5d
6 changed files with 18 additions and 12 deletions

View File

@@ -62,8 +62,8 @@ ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=
# MeiliSearch Settings
MEILISEARCH_HOST=
MEILISEARCH_KEY=
MEILI_HOST=
MEILI_MASTER_KEY=
# AWS S3 Settings
SPACES_KEY=

View File

@@ -2,7 +2,7 @@
# Purpose: Uses the Rust image to build monolith
# Notes:
# - Fine to leave extra here, as only the resulting binary is copied out
FROM docker.io/rust:1.80-bullseye AS monolith-builder
FROM docker.io/rust:1.85-bullseye AS monolith-builder
RUN set -eux && cargo install --locked monolith

View File

@@ -1,4 +1,3 @@
version: "3.5"
services:
postgres:
image: postgres:16-alpine
@@ -11,11 +10,19 @@ services:
environment:
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
restart: always
# build: . # uncomment this line to build from source
image: ghcr.io/linkwarden/linkwarden:latest # comment this line to build from source
# build: . # uncomment to build from source
image: ghcr.io/linkwarden/linkwarden:latest # comment to build from source
ports:
- 3000:3000
volumes:
- ./data:/data/data
depends_on:
- postgres
- meilisearch
meilisearch:
image: getmeili/meilisearch:v1.12.8
restart: always
env_file:
- .env
volumes:
- ./meili_data:/meili_data

View File

@@ -1,10 +1,10 @@
import { MeiliSearch } from "meilisearch";
const host = process.env.MEILISEARCH_HOST;
const apiKey = process.env.MEILI_MASTER_KEY;
export const meiliClient = host
export const meiliClient = apiKey
? new MeiliSearch({
host,
apiKey: process.env.MEILISEARCH_KEY,
host: process.env.MEILI_HOST || "http://meilisearch:7700",
apiKey,
})
: null;

View File

@@ -9,7 +9,7 @@ const handleMonolith = async (link: Link, content: string) => {
try {
let html = execSync(
`monolith - -I -b "${link.url}" ${
process.env.MONOLITH_CUSTOM_OPTIONS || "-j -F -s"
process.env.MONOLITH_CUSTOM_OPTIONS || "-j -F -q"
} -o -`,
{
timeout: 120000,

View File

@@ -2,7 +2,6 @@ import "dotenv/config";
import { prisma } from "../lib/api/db";
import archiveHandler from "../lib/api/archiveHandler";
import Parser from "rss-parser";
import { hasPassedLimit } from "../lib/api/verifyCapacity";
import { LinkWithCollectionOwnerAndTags } from "../types/global";
import getLinkBatch from "../lib/api/getLinkBatch";
import { meiliClient } from "../lib/api/meilisearchClient";