This is a starter-kit repo for an easy installation with docker.
Get the latest release or clone the repo with
git clone https://github.com/ammannbe/RecipeManagerDocker.git- Copy the .env.example files and edit them to your needs:
# Global:
cp .env.example .env
nano .env
# Api:
cp ./api/.env.example ./api/.env
chown 1000:1000 ./api/.env
nano ./api/.env
# Web:
cp ./web/.env.example ./web/.env
nano ./web/.env- For help about the .env variables see
- IMPORTANT: make sure that you changed the
APP_ENVtoproduction - Edit the docker-compose.yml to your needs:
- Optional: automatically start the container after system boot with systemd:
- Copy or symlink the recipe-manager.service service file to
/etc/systemd/system/recipe-manager.service. - Enable the service:
systemctl enable recipe-manager.service - Start the service:
systemctl start recipe-manager.service
If you have the registration disabled, create the first user via CLI:
- Start the PHP tinker CLI
docker-compose exec api php artisan tinker- Create the user and give admin rights
$name = '<YOUR FULL NAME>';
$email = '<YOUR EMAIL ADDRESS>';
$password = '<YOUR PASSWORD>';
$user = User::create([
'email' => $email,
'password' => \Hash::make($password),
]);
$user->admin = true; $user->update();
$user->author()->create(['name' => $name]);
$user->markEmailAsVerified();With the volumes: option you can overwrite every file/folder from the containers.
Example:
services:
app:
...
volumes:
- ./api/.env:/var/www/html/.env
- ./api/entrypoint.sh:/usr/local/bin/entrypoint.sh
- ./api/html:/var/www/html
- ./api/ports.conf:/etc/apache2/ports.conf
- ./api/data/app:/var/www/html/storage/app
- ./shared/data/favicon.ico:/var/www/html/public/favicon.ico
db:
...
volumes:
- ./data/api/mysql:/var/lib/mysqlIn the container web you can override following paths:
- ./web/.env:/usr/src/recipe-manager/.env This folder contains your database
- ./web/entrypoint.sh:/usr/local/bin/entrypoint.sh This script is executet at the ENTRYPOINT (see Dockerfile)
- ./shared/data/favicon.ico:/usr/src/recipe-manager/static/favicon.ico Specify a custom favicon
In the containers app, scheduler, queue you can override following paths:
- ./api/.env:/var/www/html/.env This is the environement variable file
- ./api/entrypoint.sh:/usr/local/bin/entrypoint.sh This script is executet at the ENTRYPOINT (see Dockerfile)
- ./api/html:/var/www/html This is the folder containing all project files
- ./api/ports.conf:/etc/apache2/ports.conf Specify a custom Apache HTTP port
- ./api/data/app:/var/www/html/storage/app This folder contains user data like recipe images
- ./shared/data/favicon.ico:/var/www/html/public/favicon.ico Specify a custom favicon
In the container db you can override following paths:
- ./api/data/mysql:/var/lib/mysql This folder contains your database
In the container meilisearch you can override following paths:
- ./api/data/meilisearch:/data.ms This folder contains your indexed db models for searching