-
Notifications
You must be signed in to change notification settings - Fork 1
03. Running with Docker
Docker images are provided to run the ready-to-use Jaxon applications.
Each image is tagged with its framework name, and optionally the application version number.
For example lagdo/jaxon-dbadmin:slim, lagdo/jaxon-dbadmin:0.11-slim and lagdo/jaxon-dbadmin:0.11.1-slim.
The same exists for laravel and symfony.
Running an image requires to provide the .env and .env.dbadmin files, the Jaxon DbAdmin application config files to be located in the config/dbadmin subdir, and optionally any other config file used by the framework.
The following CLI commands run the applications with their default authentication system, which is the local database for Laravel and Symfony, and a local json file for Slim.
# Laravel
docker run --rm -p 8080:8080 \
-v ./.env:/var/www/.env:ro \
-v ./.env.dbadmin:/var/www/.env.dbadmin:ro \
-v ./config/dbadmin:/var/www/config/dbadmin:ro \
-v dbadmin_data:/var/www/storage/data \
-e DB_DATABASE=storage/data/dbadmin.sqlite \
-e RUN_COMPOSER=true \
-e COMPOSER_OPTIONS="run dbadmin-create-localdb" \
lagdo/jaxon-dbadmin:laravel
# Symfony
docker run --rm -p 8080:8080 \
-v ./.env:/var/www/.env:ro \
-v ./.env.dbadmin:/var/www/.env.dbadmin:ro \
-v ./config/dbadmin:/var/www/config/dbadmin:ro \
-v dbadmin_data:/var/www/var/data \
-e DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/dbadmin.sqlite \
-e RUN_COMPOSER=true \
-e COMPOSER_OPTIONS="run dbadmin-create-localdb" \
lagdo/jaxon-dbadmin:symfony
# Slim
docker run --rm -p 8080:8080 \
-v ./.env:/var/www/.env:ro \
-v ./.env.dbadmin:/var/www/.env.dbadmin:ro \
-v ./config/dbadmin:/var/www/config/dbadmin:ro \
-v dbadmin_data:/var/www/storage/data \
-e USERS_JSON_FILE=storage/data/slim_users.json \
lagdo/jaxon-dbadmin:slimThese are the corresponding Docker Compose options.
# Laravel
dbadmin:
container_name: dbadmin
image: lagdo/jaxon-dbadmin:laravel
environment:
- DB_DATABASE=storage/data/dbadmin.sqlite
- RUN_COMPOSER=true
- COMPOSER_OPTIONS=run dbadmin-create-localdb
volumes:
- ./.env:/var/www/.env:ro
- ./.env.dbadmin:/var/www/.env.dbadmin:ro
- ./config/dbadmin:/var/www/config/dbadmin:ro
- dbadmin_data:/var/www/storage/data
ports:
- 8080:8080
# Symfony
dbadmin:
container_name: dbadmin
image: lagdo/jaxon-dbadmin:symfony
environment:
- DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/dbadmin.sqlite
- RUN_COMPOSER=true
- COMPOSER_OPTIONS=run dbadmin-create-localdb
volumes:
- ./.env:/var/www/.env:ro
- ./.env.dbadmin:/var/www/.env.dbadmin:ro
- ./config/dbadmin:/var/www/config/dbadmin:ro
- dbadmin_data:/var/www/var/data
ports:
- 8080:8080
# Slim
dbadmin:
container_name: dbadmin
image: lagdo/jaxon-dbadmin:slim
environment:
- USERS_JSON_FILE=storage/data/slim_users.json
volumes:
- ./.env:/var/www/.env:ro
- ./.env.dbadmin:/var/www/.env.dbadmin:ro
- ./config/dbadmin:/var/www/config/dbadmin:ro
- dbadmin_data:/var/www/storage/data
ports:
- 8080:8080Thanks to the use of an existing framework, the user authentication can be easily customized.
To achieve that, the dbadmin_data volume and environment variables in the above configs must be replaced by the implemented authentication system options.