NEW FEATURE: docker-image

This commit is contained in:
Jeroen De Meerleer 2022-09-01 12:39:43 +02:00
parent 07c4ec3864
commit bf6ba44fa5
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 130 additions and 0 deletions

78
.env Normal file
View File

@ -0,0 +1,78 @@
################
### DEFAULT ###
################
## What kind of environment. Only use prod here.
APP_ENV=prod
################
### DATABASE ###
################
## We're using a database. Look at the url below to create a database URL
## https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
## Mysql sample
DATABASE_URL="mysql://webcron:makemesecretplease@webcrondb:3306/webcron?charset=UTF8"
## Sqlite sample
#DATABASE_URL="sqlite:///storage/database.sqlite"
#################
### DEMO-MODE ###
#################
## Demo mode is used for showcasing the application. Demo mode will create a warning on every page and won't run your cronjobs
## As this will also display credentials on the login page, you should avoid enabling this on production environmnents
## Why would you want to do that anyway?
DEMO_MODE=false
## The username and password of the demo mode cannot be read from the database. Therefore we are putting these in plain-text here.
## They should be available anyway
DEMO_USER=example@example.com
DEMO_PASS=password
##################
### ENCRYPTION ###
##################
## WARNING: Consider your already saved secrets lost when changing below values
## This secret value is used to encrypt secret variables (eg. ssh-keys, http-auth passwords, etc)
SECRET=ImNotThatSecretSoPleaseChangeMe0123456789
## The encryption method used for encrypting secret variables. AES-256 is most commonly used and considered most safe.
## Please see https://www.php.net/openssl-get-cipher-methods for possible values
ENCRYPTION_METHOD="AES-256-CBC"
## Encryption can only be secure if you are sure it is not tampered.
## The value below is the hashing algorithm that is used to verify the encrypted date
HASHING_METHOD="sha256"
###################
### ENVIRONMENT ###
###################
## Debug mode is solely for development purposes only. It disables caching and enables your webcam to stream it to the web
DEBUG=false
## Cookies are used for saving autologin credentials. This sets the amount of time in seconds the credentials are saved.
## Grandma probably has a calculator somewhere if you need to check how many seconds are in a week :)
COOKIE_LIFETIME=2592000
## Unfortunatly, not everyone has the same timezone. 3:00PM in Sydney, does not mean it is 15:00 in Brussels.
## You can change this here. Need help? https://www.php.net/timezones
TZ=Europe/Brussels
## TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
## Set it to the IP address of your proxy. You can set to multiple proxies by comma-separating them
TRUSTED_PROXIES=127.0.0.1
##############
### MAILER ###
##############
## Webcron management is sending you mails when cronjob are failing. The MAILER_DSN is providing usefull information on
## the how mails are being sent. Need info? https://symfony.com/doc/current/mailer.html#transport-setup
MAILER_DSN=native://default
## Anonymous is still someone. So even if this someone is unknown you need someone who is sending your mails.
MAILER_FROM=www-data@example.com
## Now that everything is set up: go to your friends and get wasted!

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# Webcron Management (Docker Images)
(c) 2017, 2021- Jeroen De Meerleer <me@jeroened.be>
Webcron management is an easy-to-use interface to manage cronjob running on a publicly available http-location.
# How to use the container
## Docker-compose
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.yml).
3. Start the container
```` bash
docker compose up -d
````
4. Create the first user
```` bash
docker compose exec app php bin/console webcron:user add
````
5. Webcron management is available on http://localhost/

26
docker-compose.yml Normal file
View File

@ -0,0 +1,26 @@
version: '3.3'
services:
app:
image: jeroened/webcron:latest
restart: always
env_file: .env
ports:
- 80:80
depends_on:
- db
db:
image: mariadb
hostname: webcrondb
restart: always
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_USER=webcron
- MYSQL_PASSWORD=makemesecretplease
- MYSQL_DATABASE=webcron
volumes:
- webcron_db:/var/lib/mysql
volumes:
webcron_db: