diff --git a/docker-compose.yml b/compose.yaml similarity index 99% rename from docker-compose.yml rename to compose.yaml index cf2977b2..1b943ce2 100644 --- a/docker-compose.yml +++ b/compose.yaml @@ -1,7 +1,5 @@ # Creates a development environment -version: '3.5' - services: neucore_db: container_name: neucore_dev_db diff --git a/doc/Install.md b/doc/Install.md index 3691150f..7302b807 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -290,24 +290,25 @@ cd frontend && npm run build ### Docker Development Environment -Only tested on Linux and once or twice on macOS. +Needs [Docker Compose](https://docs.docker.com/compose/) V2. Only tested on Linux and once or +twice on macOS. -Copy `backend/.env.dist` file to `backend/.env` and adjust values, the database password and user are both `neucore`, -the database host is `neucore_db` and the database name also `neucore`. +Copy `backend/.env.dist` file to `backend/.env` and adjust values, the database password and user +are both `neucore`, the database host is `neucore_db` and the database name also `neucore`. - Always run `export UID` first in each console that you use to execute any of the following commands. - Build the containers: - `docker-compose build` + `docker compose build` - Start services: - `docker-compose up` + `docker compose up` - Install the app: `setup/install-docker.sh` - `docker-compose exec neucore_node npm run build` + `docker compose exec neucore_node npm run build` - After the first login, make the account with the ID 1 admin: - `docker-compose exec neucore_php bin/console make-admin 1` + `docker compose exec neucore_php bin/console make-admin 1` - Run tests and other commands in the php and node containers: - `docker-compose exec neucore_php /bin/sh` - `docker-compose exec neucore_node /bin/sh` + `docker compose exec neucore_php /bin/sh` + `docker compose exec neucore_node /bin/sh` The web application is available at http://localhost:8080, the frontend development server at http://localhost:3000. The database is also available at `127.0.0.1:30306` and it's data is stored in the `.db` subdirectory. diff --git a/doc/api-examples/app-esi-examples.php b/doc/api-examples/app-esi-examples.php index 374a71c4..799d35da 100644 --- a/doc/api-examples/app-esi-examples.php +++ b/doc/api-examples/app-esi-examples.php @@ -40,7 +40,7 @@ // $coreHttpScheme = 'http'; -$coreDomain = 'neucore_http'; // works with docker-compose +$coreDomain = 'neucore_http'; // Works with compose.yaml. $coreAppToken = base64_encode('1:secret'); $coreCharId = '96061222'; // Character with token in Neucore diff --git a/frontend/.env.development b/frontend/.env.development index ac0cd306..d36f514a 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -3,5 +3,5 @@ # Create an .env.development.local file to override the values if necessary. # The backend domain, e.g. http://localhost:8080 -# (BACKEND_HOST is defined in docker-compose.yml) +# (BACKEND_HOST is defined in compose.yaml) VUE_APP_BACKEND_HOST=$BACKEND_HOST diff --git a/setup/dist-docker.sh b/setup/dist-docker.sh index f063618f..97264b2d 100755 --- a/setup/dist-docker.sh +++ b/setup/dist-docker.sh @@ -13,20 +13,20 @@ echo "NEUCORE_DATABASE_URL=mysql://user:@127.0.0.1/db?serverVersion=10.5.22-Mari # Backend cd "${DIR}"/.. || exit -docker-compose exec neucore_php sh -c "cd ../dist/build/backend && composer install --no-dev --optimize-autoloader --no-interaction" -docker-compose exec neucore_php sh -c "cd ../dist/build/backend && bin/doctrine orm:generate-proxies" -docker-compose exec neucore_php sh -c "cd ../dist/build/backend && composer openapi" +docker compose exec neucore_php sh -c "cd ../dist/build/backend && composer install --no-dev --optimize-autoloader --no-interaction" +docker compose exec neucore_php sh -c "cd ../dist/build/backend && bin/doctrine orm:generate-proxies" +docker compose exec neucore_php sh -c "cd ../dist/build/backend && composer openapi" # OpenAPI JS client cd "${DIR}"/.. || exit -docker-compose run neucore_java /app/dist/build/frontend/openapi.sh -docker-compose exec neucore_node sh -c "cd ../dist/build/frontend/neucore-js-client && npm install" -docker-compose exec neucore_node sh -c "cd ../dist/build/frontend/neucore-js-client && npm run build" +docker compose run neucore_java /app/dist/build/frontend/openapi.sh +docker compose exec neucore_node sh -c "cd ../dist/build/frontend/neucore-js-client && npm install" +docker compose exec neucore_node sh -c "cd ../dist/build/frontend/neucore-js-client && npm run build" # Frontend cd "${DIR}"/.. || exit -docker-compose exec neucore_node sh -c "cd ../dist/build/frontend && npm install" -docker-compose exec neucore_node sh -c "cd ../dist/build/frontend && npm run build" +docker compose exec neucore_node sh -c "cd ../dist/build/frontend && npm install" +docker compose exec neucore_node sh -c "cd ../dist/build/frontend && npm run build" # Collect files and create archive "${DIR}"/../dist/build/setup/dist-collect-files.sh diff --git a/setup/install-docker.sh b/setup/install-docker.sh index c3cf9169..8e0994e5 100755 --- a/setup/install-docker.sh +++ b/setup/install-docker.sh @@ -5,23 +5,23 @@ DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) # Install backend, run database migrations and generate OpenAPI files. cd "${DIR}"/.. || exit if [[ $1 = prod ]]; then - docker-compose exec neucore_php composer install --no-dev --optimize-autoloader --no-interaction - docker-compose exec neucore_php composer compile:prod --no-dev --no-interaction + docker compose exec neucore_php composer install --no-dev --optimize-autoloader --no-interaction + docker compose exec neucore_php composer compile:prod --no-dev --no-interaction else - docker-compose exec neucore_php composer install - docker-compose exec neucore_php composer compile + docker compose exec neucore_php composer install + docker compose exec neucore_php composer compile fi # Generate and build OpenAPI JavaScript client -docker-compose run neucore_java /app/frontend/openapi.sh -docker-compose exec neucore_node npm install --prefix /app/frontend/neucore-js-client -docker-compose exec neucore_node npm run build --prefix /app/frontend/neucore-js-client +docker compose run neucore_java /app/frontend/openapi.sh +docker compose exec neucore_node npm install --prefix /app/frontend/neucore-js-client +docker compose exec neucore_node npm run build --prefix /app/frontend/neucore-js-client # Build frontend -docker-compose exec neucore_node npm install +docker compose exec neucore_node npm install if [[ $1 = prod ]]; then - docker-compose exec neucore_node npm run build + docker compose exec neucore_node npm run build fi # Create database for unit tests