Recreate Docker setup for contributors to be more up to date and robust (#401)

Recreate Docker setup for contributors to be more up to date and robust
This commit is contained in:
Yuri Sizov
2022-07-10 00:55:41 +03:00
committed by GitHub
parent 2d17aaa7a0
commit 6931563dd2
411 changed files with 520 additions and 24018 deletions

105
README.md
View File

@@ -1,9 +1,19 @@
# Godot Website
This repository contains the theme and plugins used in Godot Engine's
October instance.
This repository contains the theme used by the Godot Engine's OctoberCMS/WinterCMS
instance. The theme describes both the styling of the website and the components
of its layouts, as well as some of its content.
## Development
- [OctoberCMS](https://github.com/octobercms/october) is the original CMS platform of choice.
- [WinterCMS](https://github.com/wintercms/winter) is the current CMS platform, a fork of October with more active development.
_WinterCMS_ is compatible with _OctoberCMS_, and uses the same plugin system. This is
at least true for the version of the project that we use.
This repository also contains a Docker setup to be used by contributors. It
is not used for production.
## Contributing
### Browser support
@@ -20,49 +30,71 @@ Internet Explorer isn't supported.
### Dependencies
- [Docker](https://docker.com)
- It's also possible to install PHP 7.2+, MySQL and October manually,
but this isn't covered in this README.
This project requires the following stack:
### Running the site
- PHP 7.2+ & Composer 2
- MySQL/MariaDB
- OctoberCMS/WinterCMS v1.0.xxx
There are also some linting tools that can be run locally that require Node.js.
This project comes with a [Docker](https://docker.com) setup that can be used to quickly
create a network of compatible containers. Using this setup, you can have a local copy of
the project, without the production database. For development purposes, you don't need
that database, as the only thing that is specific to production is blog posts, which can
be easily recreated if required.
### Local setup
While it is possible to configure a local environment manually,
we recommend using the provided Docker setup.
- Clone this repository.
- Put a database dump (if you have one) into the `/docker/mariadb/init` folder.
- If you have a database dump, put it into the `./docker/mariadb/init` folder.
- Make sure that your script starts with the line `USE october;` and that the file extension is `.sql`.
- Run the `./docker/restart.sh` script (this will take a while the first time).
- You might need to reinstall some plugins `/docker/php/install-plugin.sh author.name`.
- Replace `author.name` with the names in the `/plugins/[author]/[name]` folders.
- See the website at [http://localhost:8080](http://localhost:8080).
- Every `.sql` and `.sh` file from that directory will be automatically executed when building the container.
- Using a terminal, or another command-line environment, go to the `./docker` folder and execute the following command.
- You can replace `"godot-website"` with anything else to help you identify this project in your Docker manager.
- In the future, you can use the `./docker/restart.sh` script to rebuild containers.
### Restoring a database
```sh
mv /your/dump/backup-file.sql docker/mariadb/init
docker/mariadb/bash.sh
cd /docker-entrypoint-initdb.d/
mysql < 000-setup.sql
mysql < backup-file.sql
```
docker-compose -p "godot-website" up --build -d --force-recreate
```
### Interfacing with the Docker containers
The script will take a couple of minutes to run the first time. After the
build is done, the containers will automatically start and perform their
first time setup. Check the logs of the `godotengine-org--php` container,
as it takes more time to finish. You will see the following line in the
logs when it's done:
You can use the standard `docker exec -it godotengine-org--[php|mariadb] [command]` syntax or the following scripts:
> Godot Website is READY to use!
- `./docker/php/bash.sh`
- `./docker/php/install-plugin.sh`
- `./docker/php/log.sh`
- `./docker/mariadb/bash.sh`
- `./docker/mariadb/log.sh`
- `./docker/mariadb/mysql.sh`
See the website at [http://localhost:8080](http://localhost:8080). The control
panel is located at [http://localhost:8080/backend](http://localhost:8080/backend).
The default admin account is `admin/admin`.
### Setting up the theme
### Interfacing with Docker containers
- Log into the October backend (located at `/backend`) and change the frontend theme from the Settings tab.
- Alternatively, you can edit `config/cms.php` and change the theme to `godotengine` there.
- Change directory into `plugins/paulvonzimmerman/patreon` then run `composer install`.
- You should now have approximately what's in production. The only missing
pieces are everything that's stored in the production database
(blog entries).
You can use the standard syntax to either execute a shell script or connect
to the running container:
```
# Execute shell command.
docker exec -it godotengine-org--[php|mariadb] [command]
# Connect to a remote shell.
docker exec -it godotengine-org--[php|mariadb] /bin/bash
```
There are several shell scripts that come with the project, that may be useful
when developing (assuming you're running Linux or macOS):
- `./docker/php/bash.sh` starts a bash session with the PHP container.
- `./docker/php/install-plugin.sh` is used to install additional CMS plugins with `artisan`.
- `./docker/php/log.sh` is used to access logs of the PHP container.
- `./docker/mariadb/bash.sh` starts a bash session with the MariaDB container.
- `./docker/mariadb/log.sh` is used to access logs of the MariaDB container.
- `./docker/mariadb/mysql.sh` starts a MySQL shell session in the MariaDB container.
### Syntax highlighting
@@ -72,6 +104,7 @@ extension to benefit from syntax highlighting in `.htm` templates.
## Resources
- Discuss on Godot Contributors Chat [#website](https://chat.godotengine.org/channel/website) channel.
- Join the discussion on Godot Contributors Chat in the
[#website](https://chat.godotengine.org/channel/website) channel.
- When working on the theme, please take note of the
[website stats](https://stats.tuxfamily.org/godotengine.org).