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= ANTHROPIC_MODEL=
# MeiliSearch Settings # MeiliSearch Settings
MEILISEARCH_HOST= MEILI_HOST=
MEILISEARCH_KEY= MEILI_MASTER_KEY=
# AWS S3 Settings # AWS S3 Settings
SPACES_KEY= SPACES_KEY=

View File

@@ -2,7 +2,7 @@
# Purpose: Uses the Rust image to build monolith # Purpose: Uses the Rust image to build monolith
# Notes: # Notes:
# - Fine to leave extra here, as only the resulting binary is copied out # - 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 RUN set -eux && cargo install --locked monolith

View File

@@ -1,4 +1,3 @@
version: "3.5"
services: services:
postgres: postgres:
image: postgres:16-alpine image: postgres:16-alpine
@@ -11,11 +10,19 @@ services:
environment: environment:
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
restart: always restart: always
# build: . # uncomment this line to build from source # build: . # uncomment to build from source
image: ghcr.io/linkwarden/linkwarden:latest # comment this line to build from source image: ghcr.io/linkwarden/linkwarden:latest # comment to build from source
ports: ports:
- 3000:3000 - 3000:3000
volumes: volumes:
- ./data:/data/data - ./data:/data/data
depends_on: depends_on:
- postgres - 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"; 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({ ? new MeiliSearch({
host, host: process.env.MEILI_HOST || "http://meilisearch:7700",
apiKey: process.env.MEILISEARCH_KEY, apiKey,
}) })
: null; : null;

View File

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

View File

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