Based on docker-webserver.
Webserver included:
- Nginx
- PHP
- Redis
- MySQL
- composer
- cloud backups
- Mailhog (for development environment)
- NodeJS (for development environment)
git clone git@github.com:rycbar-software/website.git .
cp .env.example .env && cp www/.env.example www/.env
- COMPOSE_SEPARATOR - separator for compose files in .env file. ":" for linux/MacOS, ";" for Windows;
- COMPOSE_FILE - which docker-compose files will be included;
- SYSTEM_GROUP_ID - ID of host user group. Usually 1000;
- SYSTEM_USER_ID - ID of host user. Usually 1000;
- APP_NAME - url by which the site is accessible. For example, example.com or example.local for local development;
- ADMINISTRATOR_EMAIL - email to which we send information about certificates;
- DB_HOST - database host. By default db, but in the case when the database is on another server - specify the server address;
- DB_DATABASE - database name;
- DB_USER - the name of the user who works with the database;
- DB_USER_PASSWORD - database user password;
- DB_ROOT_PASSWORD - password of the root database user;
- AWS_S3_URL - url of cloud backup storage;
- AWS_S3_BUCKET - name of the bucket in the backup storage;
- AWS_S3_ACCESS_KEY_ID - storage key;
- AWS_S3_SECRET_ACCESS_KEY - storage password;
- AWS_S3_LOCAL_MOUNT_POINT - path to the local folder where we mount the cloud storage.
- dc-app.yml - core webserver services. Include nginx, php, redis;
- dc-db.yml - database service. Use if you database is on same server;
- dc-dev.yml - dev environment services. NPM, NodeJs, MailHog;
- dc-cloud.yml - cloud backups storage.
docker-compose build
docker-compose up -d
docker-compose run --rm composer install --no-dev -o
docker-compose run --rm artisan key:generate
docker-compose run --rm artisan storage:link
docker-compose run --rm artisan migrate
docker-compose run --rm artisan admin:create./nginx-proxy-up.sh./cgi-bin/prepare-crontab.shWebserver present standalone containers for composer, artisan and npm commands. To run commands - use next examples:
docker-compose run --rm composer [you composer command]
docker-compose run --rm composer require spatie/laravel-permission
docker-compose run --rm artisan [you artisan command]
docker-compose run --rm artisan migrate
docker-compose run --rm npm [you npm command]
docker-compose run --rm npm build