Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Docker Dev Environment #456

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -11 to -13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those are still needed (similar to those of the workers)

env_file:
- .env # Automatically load all variables from this file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to add a .env, let's add a .env.sample (even if it's empty) in the directory so that people can get it up and running quickly.

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