From the browser:
- Create codespace and run it.
If you are using VS Code (detailed instructions):
- Install the GitHub Codespaces extension
- Switch to "Remote Explorer" tab
- Select "GitHub Codespaces" from the drop-down list.
- Click the "+" button and create a codespace for the current repository.
If you are using an IDE from JetBrains:
- Run in the terminal:
tilt up- Open http://localhost:10350/.
On this page you can check logs, build status and other information. The first run may take some time, please wait until all resources are green.\
If necessary (e.g. if you change the port) you can restart the desired containers with the "Trigger update" button next to the container.
-
Open http://localhost:8080/app/ in your browser. This is the application itself.
-
If you want to install any dependencies, you can do it inside the
webcontainer (the console can be opened with therun/terminal-web.shscript).
Additionally:
If you run locally and want to stop the project, run
docker-compose stop. To remove created containers, run tilt down.
If you have any of the ports you use at startup (like 8080, 443, 5432) busy, you can change it in .env.
Login name: admin@example.org
Password: adminpassword
Login: user@example.org
Password: userpassword
In Swagger UI: http://localhost:5005
Host: 127.0.0.1
Port: 5432
Login: postgres
Password: postgres
Database: postgres
The Yii Debugger is available at http://localhost/debug
To activate and use xdebug, you can install the extension https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
You can also activate xdebug manually with the GET parameter XDEBUG_SESSION_START, for example /api/?XDEBUG_SESSION_START=1 and deactivate it with the GET parameter XDEBUG_SESSION_STOP, for example /api/?XDEBUG_SESSION_STOP=1 more https://xdebug.org/docs/remote#browser_session
You can see the logs for each resource, and you can also restart it.
The resources in Tilt:
web - web container (from docker-composer)
web-initial-sync - (Windows only) initial synchronization of files with the container
web-sync - (Windows only) continuous file synchronization with a container
web-frontend - ng serve for Angular (inside web container)
web-backend-php - runs composer install and migration for PHP backend (Yii2, folder backend/)
web-backend-ts - executes nest start --watch for TypeScript backend (nestjs)
db - container with PostgreSQL (from docker-composer)
redis - container with Redis (from docker-composer)
swagger - container with Swagger UI (API documentation) (from docker-composer)
arena - arena container (from docker-composer)
(Tiltfile) - Tilt configuration
node_modules inside the container are located on a separate volume and are not synchronized with the host, so after running npm install on the host you need to click on "Update" next to the web-frontend (or web-backend-ts) in Tilt, or manually run npm install in the desired folder
# Tilt and Docker
tilt up # Start the project
docker-compose stop # Stop the project
tilt down # Stopping the project and removing containers
docker-compose down --volumes # Stopping and removing docker containers along with volumes (database, caches, etc.)
# Container web (backend and frontend)
docker-compose exec web [command] # Runs a command in the web container
docker-compose execute web bash # Run bash in the web container (see also run/terminal-web.sh)
# composer install and migration can also be triggered by pressing "Trigger update" on web-backend-php in Tilt
docker-compose exec web composer install # composer install
docker-compose exec web ./yii migrate/up --interactive 0 # Migrations
docker-compose exec web ./yii migrate-data/up --interactive 0 # Migrations for data (dictionary, etc.)
The # npm install can also be run by pressing Trigger update" at web-frontend/web-backend-ts in Tilt
docker-compose exec -w /app/backend-ts web sh -c 'NG_CLI_ANALYTICS=ci npm install --no-audit' # npm install for backend-ts
docker-compose exec -w /app/frontend web sh -c 'cd backend-ts && NG_CLI_ANALYTICS=ci npm install --no-audit' # npm install for frontend
docker-compose exec -w /app/frontend web npm start -- --host 0.0.0.0 # npm start (starts ng serve)
docker-compose exec -w /app/frontend web npm run ng -- --help # ng start
docker-compose exec -w /app/frontend web npm run ng -- build --prod # run ng build --prodrun/terminal-web.shopens the terminal in the Docker container web (access to the yii console, npm and so on)