This GitHub repository provides a comprehensive Nginx server setup optimized for PHP applications, specifically tailored for deploying web APIs. It includes a ready-to-use template designed to streamline the development and deployment process on Railway platforms. This setup is ideal for developers looking to quickly and efficiently launch PHP-based APIs with Nginx, ensuring compatibility and performance on Railway deployments.
Informações traduzidas para português do Brasil em ./docs/README_ptBR.md
This template has some dependencies that need to be installed on your current workspace:
- Docker: Mainly used for local testing
- PHP 8.0: The current used programming language and it's minimum version
- Composer: PHP package manager
In your local host machine add the following lines to your /etc/hosts
file in order to find the application.
127.0.0.1 choir.api.com
Build your custom Docker Image running ./docker/build.sh
Exceptions:
- In case you are having some permission troubles, use
sudo
to execute the fallowing files
docker-compose up
: Standalone version
docker-compose up -d
: Daemon version
Exceptions:
- If the daemon is not allawing you to use the
0.0.0.0:80
port, change thedocker-compose.yml
file to expose the port 81:
expose:
- 3000
- 81
ports:
- 3000:3000
- 81:81
Open http://choir.api.com/ and check the headers on your devtools, and you should see this entry ping: "pong"
.