diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4ce562af942e63f997bac97c4eb087be4d7f8ac9 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# For common users: +Set the needed variables in .env (take librephotos.env as model) + +Clone the repo: `git clone git@github.com:LibrePhotos/librephotos-docker.git` + +docker-compose up -d +This will get the pre-built images and start all the needed processes + +# For developers: +Set the needed variables in .evn (take librephotos.env as model) +Also set the codedir variable that tells docker where your source folder are +Pull frontend code with `git clone https://github.com/LibrePhotos/librephotos-frontend.git ${codedir}/frontend/` + +Pull backend code into `git clone https://github.com/LibrePhotos/librephotos.git ${codedir}/backend/` + +Pull this repo and run `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d` + +This will build images from scratch (can take a long time the first time) +Now you can develop and benefit from code auto reload from both backend and frontend +N.B. If you already built this image once, when you do force rebuild you have to run + +`docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --no-cache frontend` + +`docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --no-cache backend` + +based on which one you changed if these changes need rebuild as for added dependencies/libraries etc. + +and then the usual `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d` + +If you use vscode you can also benefit auto completion and other goodies. For this just type `code .` in your dockerfile folder. +Vscode will open and ask you if you want to reopen it in the container. If you do it he will add his server to the docker layers (first time you do it can take a couple of minutes) and you will have the same python interpreter librephotos is using internally hence the same installed libraries in auto completion and the same development environment will be shared by all devs (isort, flake8 and pylint for example) diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index c4fe613457ec45f9b8b97a22b16f29c0a7f042fc..659b98934ce069bb4f765db2736a4c7b7684bdb5 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -20,5 +20,5 @@ then gunicorn --worker-class=gevent --timeout 36000 --reload --bind backend:8001 --log-level=info ownphotos.wsgi 2>&1 | tee /logs/gunicorn_django.log else echo "production backend starting" - gunicorn --worker-class=gevent --timeout 3600 --bind backend:8001 --log-level=warning ownphotos.wsgi 2>&1 + gunicorn --worker-class=gevent --timeout 3600 --bind backend:8001 --log-level=info ownphotos.wsgi 2>&1 | tee /logs/gunicorn_django.log fi diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6e4b333b6881da2dabba569864e3373c970e9cf4..650b3e0d9d76f0755103f3d0eb9ee824f2bbe988 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,7 +6,7 @@ RUN mkdir -p /usr/src/app WORKDIR /usr/src/app RUN npm install -g npm ENV CLI_WIDTH 80 -RUN git clone https://github.com/LibrePhotos/librephotos-frontend.git /usr/src/app +RUN git clone https://github.com/parruc/librephotos-frontend.git /usr/src/app RUN npm ci EXPOSE 3000 diff --git a/librephotos.env b/librephotos.env index b99c526086c9dd35ae056c57c6f06e4f76666ec2..14a44bc9a8da92cc43bd67c55e3b3450b390e348 100644 --- a/librephotos.env +++ b/librephotos.env @@ -16,9 +16,6 @@ logLocation=./librephotos/logs/ # Protected media directory. This is where we store some files like the thumbnails of your images. proMedia=./librephotos/media -# Where shall we store the backend and frontend code files. -codedir=./librephotos/code - # Where shall we store the cache files. cachedir=./librephotos/cache @@ -69,3 +66,11 @@ dbPass=AaAa1234 # You’ll want to vary this a bit to find the best for your particular workload. # Each worker needs 800MB of RAM. Change at your own will. Default is 2. gunniWorkers=2 + +# --------------------------------------------------------------------------------------------- + +# If you are not a developer ignore the following parameters: you will never need them. + +# Where shall we store the backend and frontend code files. +codedir=./librephotos/code +