From 171377020cc8034714aaa4914c86d5eed8b33651 Mon Sep 17 00:00:00 2001 From: subnub Date: Fri, 28 Feb 2025 22:43:24 -0500 Subject: [PATCH] more docker updates --- Dockerfile | 3 +++ readme.md | 48 +++++++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index abe2d39..427e82e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ FROM node:20-alpine RUN apk add --no-cache python3 make g++ ffmpeg \ && ln -sf python3 /usr/bin/python +ENV FS_DIRECTORY=/data/ +ENV TEMP_DIRECTORY=/temp/ + WORKDIR /usr/app-production COPY package*.json ./ diff --git a/readme.md b/readme.md index de8b26f..342e6ea 100755 --- a/readme.md +++ b/readme.md @@ -136,31 +136,45 @@ You can read more about this issue [here](https://stackoverflow.com/questions/38 -## 🐳 Docker +## 🐳 Docker image -Setup: +Note: This is a work in progress and may have issues, please report any issues you find. -> Create Environment Variables: - -> You can find enviroment variable examples under:
-> [backend/config](backend/config) -> Backend Enviroment Variables -> [src/config](src/config) -> Frontend Enviroment Variables - -> Simply remove the .example from the end of the filename, and fill in the values. -> Note: In most cases you will only have to change FE enviroment variables for development purposes. - -
- -> Start the Docker image +Run the following command to download the latest docker image: ```javascript -npm run docker:production +docker pull kylehoell/mydrive:latest ``` -NOTE: I made an oversight in the docker command, since it requires npm to be installed in order to run the above command, I am working on a fix for this, but here is the command itself that npm runs for now. +You must provide enviroment variables for the docker image to work. You can supply these during the docker run command instead of creating the env file.
+ +> [backend/config](backend/config) -> Backend Enviroment Variables + +You must also provide a volume for the image if you are using a filesystem database or if you want to use the generate video thumbnails feature. Volumes should be mounted to /data/ and /temp. For example: ```javascript -docker-compose -p mydrive-production -f docker-compose-production.yml --env-file ./backend/config/.env.production up +-v /path/example/mydrive/data/:/data/ -v /path/example/mydrive/temp/:/temp/ +``` + +The docker image will by default run on port 3000. + +Here is an example of the full docker command: + +```bash +docker run -d \ + -p 3000:3000 \ + -e MONGODB_URL=mongodb://127.0.0.1:27017/test \ + -e DB_TYPE=fs \ + -e PASSWORD_ACCESS=secretaccesspassword \ + -e PASSWORD_REFRESH=secretrefreshpassword \ + -e PASSWORD_COOKIE=secretcookiepassword \ + -e KEY=encryptionkey \ + -e VIDEO_THUMBNAILS_ENABLED=true \ + -e TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000 \ + -v /path/example/mydrive/data/:/data/ \ + -v /path/example/mydrive/temp/:/temp/ \ + --name mydrive \ + kylehoell/mydrive:latest ```