Skip to content

Commit

Permalink
docker: Fix the docker-based development env (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrypticC3s4r authored Oct 5, 2024
1 parent f6192da commit 3f22801
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
6 changes: 6 additions & 0 deletions docker/.env.sample
Original file line number Diff line number Diff line change
@@ -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 <openssl rand -base64 36>]
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=[generate with <openssl rand -base64 36>]
14 changes: 11 additions & 3 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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
11 changes: 5 additions & 6 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3f22801

Please sign in to comment.