diff --git a/README.md b/README.md index 412f557..e4967c3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,12 @@ Webcron management is an easy-to-use interface to manage cronjob running on a pu # How to use the container -## Docker-compose +To deploy webcron management using a docker container I have created multiple options. + +* 1 Container running daemon and webui at once (Easier) +* 2 Containers running daemon and webui in separate containers (More in accordance to docker philisophy) + +## Option 1: 1 Container (Easier) 1. Create your .env file in the root of the compose instance. You can copy the [.env from this repository](https://git.jeroened.be/webcron/docker/src/branch/main/.env) and adapt to your config. Alternatively you can can assign the environment vars in the directly in the compose file. It's up to you what is easier for you. @@ -23,4 +28,27 @@ Webcron management is an easy-to-use interface to manage cronjob running on a pu docker compose exec app php bin/console webcron:user add ```` -5. Webcron management is available on http://localhost/ \ No newline at end of file +5. Webcron management is available on http://localhost/ + +## Option 1: 2 Containers (Recommended) + +1. Create your .env file in the root of the compose instance. You can copy the [.env from this repository](https://git.jeroened.be/webcron/docker/src/branch/main/.env) and adapt to your config. + + Alternatively you can can assign the environment vars in the directly in the compose file. It's up to you what is easier for you. + +2. Create your docker-compose file. You can copy the example config from [this repository](https://git.jeroened.be/webcron/docker/src/branch/main/docker-compose.separate.yml). + +3. Start the container + +```` bash + docker compose up -d +```` + +4. Create the first user + +```` bash + docker compose exec daemon php bin/console webcron:user add +```` + +5. Webcron management is available on http://localhost/ + diff --git a/docker-compose.seperate.yml b/docker-compose.seperate.yml new file mode 100644 index 0000000..4a9d15a --- /dev/null +++ b/docker-compose.seperate.yml @@ -0,0 +1,46 @@ +version: '3.3' + +services: + app: + image: jeroened/webcron:dev-webui + restart: always + env_file: .env + networks: + - webcron + depends_on: + - db + volumes: + - webcron_cache:/var/www/webcron/var/cache + + daemon: + image: jeroened/webcron:dev-daemon + restart: always + env_file: .env + networks: + - webcron + depends_on: + - db + volumes: + - webcron_cache:/var/www/webcron/var/cache + + db: + image: mariadb + hostname: webcrondb + restart: always + networks: + - webcron + environment: + - MYSQL_RANDOM_ROOT_PASSWORD=yes + - MYSQL_USER=webcron + - MYSQL_PASSWORD=makemesecretplease + - MYSQL_DATABASE=webcron + volumes: + - webcron_db:/var/lib/mysql + +networks: + webcron: + driver: bridge + +volumes: + webcron_db: + webcron_cache: