diff --git a/.docker/README.md b/.docker/README.md index 0ed69a3..8a5d7a8 100644 --- a/.docker/README.md +++ b/.docker/README.md @@ -14,13 +14,13 @@ 3. Copy `.env.example` to `.env`. Leave the `.env` file as is for now. 4. Copy `docker-compose.example.yml` to `docker-compose.yml`. 5. Edit `docker-compose.yml` (with your text editor) and modify configuration/volumes to match your needs. -6. Edit `../.env` and modify your database credentials to match the ones you set in `docker-compose.yml` +6. Edit `.env` and modify your database credentials to match the ones you set in `docker-compose.yml` - `DB_HOST` (db) and `DB_PORT` (5432) can generally be left as is 7. Navigate to the `.docker` directory in the repository. 8. Copy `examples/hovedprosjekt.example.conf` to `nginx/hovedprosjekt.conf`. 9. Edit `nginx/hovedprosjekt.conf` and modify domain/TLS configuration to your needs. - Make sure that the SSL certificate and key uses the path as the volume mapping in `docker-compose.yml`. -10. Run `docker-compose build app` +10. Go up one directory (`cd ..`) and run `docker-compose build app` 11. If built successfully, run `docker-compose up -d` to run all containers in "detached" mode. ## Application setup - First-time setup only @@ -29,9 +29,8 @@ These steps should be run after you have run `docker-compose up -d`, as the cont 1. Go to the project repository: `cd /srv/FLOTWebApp` 2. Make sure that the project repository has correct permissions for the user specified in `docker-compose.yml` - - `sudo chown -R 1000: .` will set it to the user with ID "1000". You can see users and their IDs if you `cat /etc/passwd`. -3. While still being in the `.docker` directory run: `docker-compose exec app composer install` - - This will attach the `app` container and run the following command to install dependencies for the application: `composer install` + - `sudo chown -R 1000:1000 .` will set it to the user/group with ID "1000". You can see users and their IDs if you `cat /etc/passwd`. +3. Install Composer dependencies using: `docker-compose exec app composer install` - Dependency installation might take a while, so be patient. 4. Run `docker-compose exec app php artisan key:generate` to generate an app key that's saved in `.env` 5. Finally, create the database tables with: `docker-compose exec app php artisan migrate`