diff --git a/docker/.env.sample b/docker/.env.sample index 0b1471a0..5d720e28 100644 --- a/docker/.env.sample +++ b/docker/.env.sample @@ -3,4 +3,5 @@ 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 +NEXTAUTH_SECRET=[generate with ] +DOCKER_DATA_DIR=[replace with the directory for persistent data] diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 95883ce5..c94b4812 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -4,7 +4,7 @@ services: build: dockerfile: Dockerfile.dev volumes: - - data:/data + - ${DOCKER_DATA_DIR}/data:/data - ..:/app ports: - 3000:3000 @@ -30,12 +30,12 @@ services: meilisearch: image: getmeili/meilisearch:v1.6 volumes: - - meilisearch:/meili_data + - ${DOCKER_DATA_DIR}/meilisearch:/meili_data workers: build: dockerfile: Dockerfile.dev volumes: - - data:/data + - ${DOCKER_DATA_DIR}/data:/data - ..:/app working_dir: /app environment: @@ -56,13 +56,10 @@ services: environment: DATA_DIR: /data volumes: - - data:/data + - ${DOCKER_DATA_DIR}/data:/data - ..:/app command: - /bin/sh - -c - "pnpm install --frozen-lockfile && pnpm run db:migrate" -volumes: - meilisearch: - data: diff --git a/docs/docs/07-Development/01-setup.md b/docs/docs/07-Development/01-setup.md index 3bf9caf1..11b9d7e9 100644 --- a/docs/docs/07-Development/01-setup.md +++ b/docs/docs/07-Development/01-setup.md @@ -60,4 +60,13 @@ In dev mode, opening and closing the plugin menu should reload the code. ## Docker Dev Env -If the manual setup is too much hassle for you. You can use a docker based dev environment by running `docker compose -f docker/docker-compose.dev.yml up` in the root of the repo. This setup wasn't super reliable for me though. +If the manual setup is too much hassle for you, you can use a docker based dev environment instead by following the instructions: + +- Clone the repo and navigate to the root of the repo. +- Run `cp /docker/.env.sample /docker/.env` +- Make the necessary changes to the .env file (setting the DOCKER_DATA_DIR, NEXTAUTH_SECRET, and MEILI_MASTER_KEY) +- Run `docker compose -f docker/docker-compose.dev.yml up --build` in the root of the repo. + +### Notes +- The inital set up takes a while, do not be concerned for very long build times. +- The application is ready to work when the web-1 container says "Ready" on the next.js block