diff --git a/docker/.env.sample b/docker/.env.sample new file mode 100644 index 00000000..0b1471a0 --- /dev/null +++ b/docker/.env.sample @@ -0,0 +1,6 @@ +# See https://docs.hoarder.app/configuration for more information +DATA_DIR=/data +MEILI_ADDR=http://127.0.0.1:7700 +MEILI_MASTER_KEY=[generate with ] +NEXTAUTH_URL=http://localhost:3000 +NEXTAUTH_SECRET=[generate with ] \ No newline at end of file diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index cd15b20d..61a6374f 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -1,6 +1,14 @@ FROM node:21-alpine -RUN apk add --no-cache libc6-compat make g++ py3-pip linux-headers -ENV PUPPETEER_SKIP_DOWNLOAD true - WORKDIR /app +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" + +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +RUN apk add --no-cache libc6-compat make g++ py3-pip linux-headers git + +RUN corepack enable + +COPY . . +ENV NEXT_TELEMETRY_DISABLED 1 +ENV PUPPETEER_SKIP_DOWNLOAD true diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 94242f63..95883ce5 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -8,9 +8,8 @@ services: - ..:/app ports: - 3000:3000 - environment: - MEILI_ADDR: http://meilisearch:7700 - DATA_DIR: /data + env_file: + - .env # Automatically load all variables from this file command: - pnpm - web @@ -60,9 +59,9 @@ services: - data:/data - ..:/app command: - - /bin/sh - - -c - - "corepack enable && pnpm install --frozen-lockfile && pnpm run db:migrate" + - /bin/sh + - -c + - "pnpm install --frozen-lockfile && pnpm run db:migrate" volumes: meilisearch: