This software runs completely on Docker, there are four services being orchestrated with Docker Compose:
- mysql(MySQL 8.0),
- php(PHP 8.0 FPM),
- nginx(NGINX 1.20 Alpine)
- vue(Vue 3 frontend).
- Copy ./api/.env.example and set the allowed origin. This is important, so the API can respond to its frontend.
cp ./api/.env.example ./api/.env.dev.local
- Copy the ./docker/docker-compose.env.example and fill the variables out.
cp ./docker/docker-compose.env.example ./docker/docker-compose.env
- Copy the NGINX & Xdebug config files and set your local hostname; also don't forget to add the hostname to your host's
/etc/hosts
and the Xdebug port.
cp ./docker/nginx/default.conf.example ./docker/nginx/server/default.conf
cp ./docker/php/conf.d/docker-php-ext-debug.ini.example ./docker/php/conf.d/docker-php-ext-debug.ini
4.1. Copy the frontend config file and set the variables:
cp ./frontend/.env.development.local.example ./frontend/.env.development.local
4.2. Install npm dependencies
In the vaults_vue
container:
npm install
- Create the SSL certificate and its corresponding key for your hostname.
sudo openssl req -x509 \
-nodes \
-days 365 \
-newkey rsa:2048 \
-keyout /etc/ssl/private/selfsigned/site.key \
-out /etc/ssl/certs/selfsigned/site.crt
- Copy the certificate + key in the project files for docker compose, and then import them in your preferred browser.
cp /etc/ssl/private/selfsigned/site.key ./docker/nginx/password-manager.key
cp /etc/ssl/certs/selfsigned/site.crt ./docker/nginx/password-manager.crt
- Build the images & create the containers with docker-compose.
cd ./docker;
docker-compose --env-file docker-compose.env up --build --detach
- Create the database.
docker exec -it vaults_php ./bin/console doctrine:migrations:migrate --env=dev
- You can also monitor the other containers like so:
docker logs --follow vaults_nginx
That's it! Now you have an instance of vaults running!