Last active
April 8, 2024 04:53
-
-
Save joekrill/cc503e21e14f95fefa91acc5f869dac1 to your computer and use it in GitHub Desktop.
Linkwarden Docker Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
volumes: | |
postgres: | |
services: | |
postgres: | |
image: postgres | |
restart: unless-stopped | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -d linkwarden -U linkwarden || exit 1"] | |
interval: 5s | |
timeout: 5s | |
start_period: 30s | |
retries: 10 | |
environment: | |
POSTGRES_HOST_AUTH_METHOD: "trust" | |
POSTGRES_USER: linkwarden | |
POSTGRES_PASSWORD: Linkwarden123! | |
POSTGRES_DB: linkwarden | |
volumes: | |
- postgres:/var/lib/postgresql | |
linkwarden-migrate: &linkwarden-service | |
image: "linkwarden/linkwarden" | |
restart: on-failure | |
build: | |
context: https://github.com/linkwarden/linkwarden.git#main | |
dockerfile_inline: | | |
FROM node:20 | |
WORKDIR /opt/linkwarden | |
COPY . . | |
RUN yarn && \ | |
npx [email protected] install-deps && \ | |
yarn build | |
ENTRYPOINT ["yarn"] | |
CMD ["start"] | |
command: prisma migrate deploy | |
environment: | |
- DATABASE_URL=postgres://linkwarden:Linkwarden123!@postgres:5432/linkwarden?sslmode=disable&max_conns=20&max_idle_conns=4 | |
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-DR5o8dX6SR5#g*@7z!k2%8#sf5S@RR6F} | |
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000} | |
- PAGINATION_TAKE_COUNT | |
- STORAGE_FOLDER | |
- SPACES_KEY | |
- SPACES_SECRET | |
- SPACES_ENDPOINT | |
- SPACES_REGION | |
- NEXT_PUBLIC_EMAIL_PROVIDER | |
- EMAIL_FROM | |
- EMAIL_SERVER | |
depends_on: | |
postgres: | |
condition: service_healthy | |
linkwarden: | |
<<: *linkwarden-service | |
restart: unless-stopped | |
command: start | |
ports: | |
- 3000:3000 | |
depends_on: | |
linkwarden-migrate: | |
condition: service_completed_successfully |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi thanks for the docker-compose.yml
I'm a beginner on this and i've got this error :
'
http: invalid Host header`
I tried to add a parameter called "HOST" on the environment part. but it doesn't work.
When i used "docker compose logs linkwarden" i've this output :
linkwarden-linkwarden-1 | Error: P1001: Can't reach database server at
postgres:
5432linkwarden-linkwarden-1 | linkwarden-linkwarden-1 | Please make sure your database server is running at
postgres:
5432. linkwarden-linkwarden-1 | error Command failed with exit code 1. linkwarden-linkwarden-1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. linkwarden-linkwarden-1 | yarn run v1.22.19 linkwarden-linkwarden-1 | $ /data/node_modules/.bin/prisma migrate deploy linkwarden-linkwarden-1 | Prisma schema loaded from prisma/schema.prisma linkwarden-linkwarden-1 | Datasource "db": PostgreSQL database "postgres", schema "public" at "postgres:5432
i've made some update to be sure that linkwarden container is waiting for postgre container but i've this the same error (invalid host header)
Could you help me ?
Thanks in advance.
EDIT :
Hi, the host error seems to be dependent on the docker version. when i tried with docker 24.0.5 i didn't get the error anymore