Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jolicode/docker-starter
🏗️ A skeleton to start a new web project with PHP, Docker and Castor
https://github.com/jolicode/docker-starter
castor docker docker-compose github-template hacktoberfest php
Last synced: 3 months ago
JSON representation
🏗️ A skeleton to start a new web project with PHP, Docker and Castor
- Host: GitHub
- URL: https://github.com/jolicode/docker-starter
- Owner: jolicode
- License: mit
- Created: 2019-07-08T12:44:51.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T12:15:18.000Z (3 months ago)
- Last Synced: 2024-10-25T07:19:34.112Z (3 months ago)
- Topics: castor, docker, docker-compose, github-template, hacktoberfest, php
- Language: PHP
- Homepage:
- Size: 3.18 MB
- Stars: 336
- Watchers: 17
- Forks: 34
- Open Issues: 4
-
Metadata Files:
- Readme: README.dist.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# My project
## Running the application locally
### Requirements
A Docker environment is provided and requires you to have these tools available:
* Docker
* Bash
* [Castor](https://github.com/jolicode/castor#installation)#### Castor
Once castor is installed, in order to improve your usage of castor scripts, you
can install console autocompletion script.If you are using bash:
```bash
castor completion | sudo tee /etc/bash_completion.d/castor
```If you are using something else, please refer to your shell documentation. You
may need to use `castor completion > /to/somewhere`.Castor supports completion for `bash`, `zsh` & `fish` shells.
### Docker environment
The Docker infrastructure provides a web stack with:
- NGINX
- PostgreSQL
- PHP
- Traefik
- A container with some tooling:
- Composer
- Node
- Yarn / NPM### Domain configuration (first time only)
Before running the application for the first time, ensure your domain names
point the IP of your Docker daemon by editing your `/etc/hosts` file.This IP is probably `127.0.0.1` unless you run Docker in a special VM (like docker-machine for example).
> [!NOTE]
> The router binds port 80 and 443, that's why it will work with `127.0.0.1````
echo '127.0.0.1 ' | sudo tee -a /etc/hosts
```### Starting the stack
Launch the stack by running this command:
```bash
castor start
```> [!NOTE]
> the first start of the stack should take a few minutes.The site is now accessible at the hostnames your have configured over HTTPS
(you may need to accept self-signed SSL certificate if you do not have mkcert
installed on your computer - see below).### SSL certificates
HTTPS is supported out of the box. SSL certificates are not versioned and will
be generated the first time you start the infrastructure (`castor start`) or if
you run `castor docker:generate-certificates`.If you have `mkcert` installed on your computer, it will be used to generate
locally trusted certificates. See [`mkcert` documentation](https://github.com/FiloSottile/mkcert#installation)
to understand how to install it. Do not forget to install CA root from mkcert
by running `mkcert -install`.If you don't have `mkcert`, then self-signed certificates will instead be
generated with openssl. You can configure [infrastructure/docker/services/router/openssl.cnf](infrastructure/docker/services/router/openssl.cnf)
to tweak certificates.You can run `castor docker:generate-certificates --force` to recreate new certificates
if some were already generated. Remember to restart the infrastructure to make
use of the new certificates with `castor up` or `castor start`.### Builder
Having some composer, yarn or other modifications to make on the project?
Start the builder which will give you access to a container with all these
tools available:```bash
castor builder
```### Other tasks
Checkout `castor` to have the list of available tasks.