[Digital Mary][dm] (affectionately known as DM) is a PHP application written using the [Symfony Framework][symfony]. It is a digital tool for collecting images of artefacts relating to the Virgin Mary.
- Docker Desktop
- A copy of the
dm.sql
database sql file. If you are not sure what these are or where to get them, you should contact the Digital Humanities Innovation Lab for access. This file should be placed in the root folder.
First you must setup the database for the first time
docker compose up -d db
# wait 30 after the command has fully completed
# copy the `dm.sql` into the container
docker cp dm.sql dm_db:/dm.sql
docker exec -it dm_db bash -c "mysql -u dm -ppassword dm < /dm.sql"
Next you must start the whole application
docker compose up -d --build
dm will now be available at http://localhost:8080/
docker exec -it dm_app ./bin/console nines:user:create <[email protected]> '<your full name>' '<affiliation>'
docker exec -it dm_app ./bin/console nines:user:password <[email protected]> <password>
docker exec -it dm_app ./bin/console nines:user:promote <[email protected]> ROLE_ADMIN
docker exec -it dm_app ./bin/console nines:user:activate <[email protected]>
example:
docker exec -it dm_app ./bin/console nines:user:create [email protected] 'Test User' 'DHIL'
docker exec -it dm_app ./bin/console nines:user:password [email protected] test_password
docker exec -it dm_app ./bin/console nines:user:promote [email protected] ROLE_ADMIN
docker exec -it dm_app ./bin/console nines:user:activate [email protected]
docker compose up -d
docker compose down
docker compose up -d --build
docker logs -f dm_app
docker logs -f dm_db
docker logs -f dm_mail
http://localhost:8080/
Command line:
docker exec -it dm_db mysql -u dm -ppassword dm
Through a database management tool:
- Host:
127.0.0.1
- Port:
13306
- Username:
dm
- Password:
password
http://localhost:8025/
Migrate up to latest
docker exec -it dm_app make migrate
First setup an image to build the yarn deps in
docker build -t dm_yarn_helper --target dm-prod-assets .
Then run the following as needed
# add new package
docker run -it --rm -v $(pwd)/public:/app dm_yarn_helper yarn add [package]
# update a package
docker run -it --rm -v $(pwd)/public:/app dm_yarn_helper yarn upgrade [package]
# update all packages
docker run -it --rm -v $(pwd)/public:/app dm_yarn_helper yarn upgrade
Note: If you are having problems starting/building the application due to javascript dependencies issues you can also run a standalone node container to help resolve them
docker run -it --rm -v $(pwd)/public:/app -w /app node:19.5 bash
[check Dockerfile for the 'apt-get update' code piece of dm-prod-assets]
yarn ...
After you update a dependency make sure to rebuild the images
docker compose down
docker compose up -d
# add new package
docker exec -it dm_app composer require [vendor/package]
# add new dev package
docker exec -it dm_app composer require --dev [vendor/package]
# update a package
docker exec -it dm_app composer update [vendor/package]
# update all packages
docker exec -it dm_app composer update
Note: If you are having problems starting/building the application due to php dependencies issues you can also run a standalone php container to help resolve them
docker run -it -v $(pwd):/var/www/html -w /var/www/html dhilsfu/symfony-base:php-8.2-apache bash
[check Dockerfile for the 'apt-get update' code piece of dm]
composer ...
After you update a dependency make sure to rebuild the images
docker compose down
docker compose up -d
First make sure the application and database are started with docker compose up -d
docker exec -it dm_app make test
docker exec -it dm_app make test.cover
make test.cover.view
If the coverage file doesn't open automatically you can manually open it coverage/index.html
See standards errors
docker exec -it dm_app make lint-all
docker exec -it dm_app make symlint
# or
docker exec -it dm_app make stan
docker exec -it dm_app make twiglint
docker exec -it dm_app make twigcs
docker exec -it dm_app make yamllint
docker exec -it dm_app make symlint
Automatically fix some standards errors
docker exec -it dm_app make fix.all
docker exec -it dm_app make dump.autowire
docker exec -it dm_app make dump.container
docker exec -it dm_app make dump.env
docker exec -it dm_app make dump.params
docker exec -it dm_app make dump.router
docker exec -it dm_app make dump.twig
Will take all revision
style contributions (list of initials from revisions) and generate new Author
Contributions records for each (generating new Person records as needed).
Also add a Data Manager
record for each item.
docker exec -it dm_app ./bin/console app:migrate:item_contributions
Note: Should only really be run one time after the
Version20240127003119
migration