👷♂️ Installation
For Developers
- Do not use a relative path, because the sudo command usually starts in the root folder and does not represent the actual folder you are in.
- When using docker compose v2, replace command
docker-compose
withdocker compose
in the following instructions.
Create a directory for the project: this is where all the Git repositories will be cloned into. In this guide, we will
use "~/home/dev/librephotos
as an example.
Pull frontend code with git clone https://github.com/LibrePhotos/librephotos-frontend.git
Pull backend code into git clone https://github.com/LibrePhotos/librephotos.git
Pull librephotos-docker repo git clone https://github.com/LibrePhotos/librephotos-docker.git
Setting up in Linux
codedir=~/home/dev/librephotos
cd $codedir
git clone https://github.com/LibrePhotos/librephotos-frontend.git
git clone https://github.com/LibrePhotos/librephotos.git
git clone https://github.com/LibrePhotos/librephotos-docker.git
Setting up on Windows
In PowerShell:
$Env:codedir = "~/home/dev/librephotos"
CD $Env:codedir
git clone https://github.com/LibrePhotos/librephotos-frontend.git
git clone https://github.com/LibrePhotos/librephotos.git
git clone https://github.com/LibrePhotos/librephotos-docker.git
Configuring the environment
Go to the librephotos-docker
directory you just cloned. Create a new file .env (take librephotos.env as a reference) and set the needed variables in it. Make sure you set the codedir
variable that tells
docker, where your source folders are. This should be the same path as used to clone your repos.
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.
If you already built this image once, when you do force rebuild you have to run the build command based on which area you changed with added dependencies/libraries etc.
docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --no-cache frontend
# OR
docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --no-cache backend
Once you have rebuilt, you can run the docker compose up command again to update the running instances.
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
Next Steps
Next, take a look at the first steps after setup.