Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 2fab4d3

Browse files
committed
docs: Add Docker deployment and improve writing
1 parent d014228 commit 2fab4d3

File tree

1 file changed

+42
-12
lines changed

1 file changed

+42
-12
lines changed

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
# Database Playground
22

3-
This platform allows you to exercise your SQL skills through a simple gamification system.
3+
The Database Playground is a platform designed to enhance your SQL skills through an engaging gamification system.
44

55
## Development
66

77
### Preparation
88

9-
- Use PhpStorm for PHP and Twig development, and VS Code for TypeScript development.
10-
- [Devenv](https://devenv.sh) provides the development environment, including pre-commit hooks, PHP, and Node.js runtimes.
11-
- [Docker Compose](https://docs.docker.com/compose/) sets up the development runtime environment.
9+
- Use **PhpStorm** for PHP and Twig development, and **VS Code** for TypeScript development.
10+
- **Devenv** provides a comprehensive development environment, including pre-commit hooks and runtimes for PHP and
11+
Node.js. Learn more at [Devenv](https://devenv.sh).
12+
- **Docker Compose** is utilized to set up the development runtime environment. For more details, visit
13+
the [Docker Compose documentation](https://docs.docker.com/compose/).
1214

1315
### Setup
1416

1517
1. Clone the repository.
1618
2. Run `devenv up` to start the development environment.
17-
3. Execute `composer install` to install the PHP dependencies.
18-
4. Run `pnpm install` to install the Node.js dependencies. This step is optional but helpful if you prefer type declarations when developing TypeScript.
19-
5. Start the database, Redis, and PHP runtime by running `docker compose up -d`.
20-
6. Create an administrator user with the command: `php ./bin/console app:create-user -p "yourpassword" -r "ROLE_ADMIN" "admin" "admin@youremail.tld"`.
21-
7. (Optional) Import the schema and questions by running `php ./bin/console app:import schema.json`.
22-
8. Navigate to `https://localhost` to access the application. Use `https://localhost/admin` to access the admin panel.
19+
3. Execute `composer install` to install PHP dependencies.
20+
4. Run `pnpm install` to install Node.js dependencies, which is useful for type checking.
21+
5. Start the database, Redis, and PHP runtime for development:
22+
```bash
23+
docker compose up -d
24+
```
25+
6. Create an administrator user by running:
26+
```bash
27+
php ./bin/console app:create-user -p "yourpassword" -r "ROLE_ADMIN" "admin" "admin@youremail.tld"
28+
```
29+
7. (Optional) Import the schema and questions using:
30+
```bash
31+
php ./bin/console app:import schema.json
32+
```
33+
8. Access the application at `https://localhost`, and use `https://localhost/admin` to access the admin panel.
2334

2435
## Deployment
2536

37+
### Zeabur
38+
2639
1. Deploy Redis, PostgreSQL, Meilisearch, and Umami (for statistics) on Zeabur.
2740
2. Deploy the application in Git mode on Zeabur.
2841
3. Add the following environment variables to the application:
@@ -32,9 +45,26 @@ This platform allows you to exercise your SQL skills through a simple gamificati
3245
APP_SECRET=${PASSWORD}
3346
MEILISEARCH_URL=http://meilisearch.zeabur.internal:7700
3447
MEILISEARCH_API_KEY=${MEILI_MASTER_KEY}
48+
UMAMI_DOMAIN=your-umami-domain.tld
49+
UMAMI_WEBSITE_ID=your-website-id
50+
OPENAI_API_KEY=your-openai-api-key
51+
LINE_NOTIFY_DSN=linenotify://line-notify-token@default
3552
```
3653
4. Create an index in Meilisearch by running:
37-
```
54+
```bash
3855
php bin/console meili:create --update-settings
3956
```
40-
5. Bind your domain, and it will be ready for use.
57+
5. Bind your domain, and the application will be ready for use.
58+
59+
### Docker
60+
61+
We provide a Docker Compose configuration based on [Symfony Docker](https://github.com/dunglas/symfony-docker) for
62+
deployment. The prebuilt image is available at
63+
the [GitHub Registry](https://github.com/database-playground/app-sf/pkgs/container/app-sf).
64+
65+
To deploy the application, you may need to update the secret or environment variables in the `compose.yaml` and
66+
`compose.prod.yaml` files, and then run the following command:
67+
68+
```bash
69+
docker compose -f compose.yaml -f compose.prod.yaml up -d
70+
```

0 commit comments

Comments
 (0)