Closed bos21001 closed 1 year ago
This will all be set with Laradock with Ngnix, PHP-FPM (8.2) (Apiato 11), Postgres 15 and workspace, by following the instructions below:
git clone https://github.com/laradock/laradock.git
git clone git@github.com:bos21001/familiasm-api.git
Step 2: Configure Laradock
Navigate to the Laradock directory and create a .env
file by copying the env-example
file.
cd laradock
cp env-example .env
Open the .env
file and set the PHP_FPM_VERSION
to 8.2
.
PHP_FPM_VERSION=8.2
laradock/nginx/sites
.default.conf.example
to create a new configuration file.cd nginx/sites cp default.conf.example familiasm-api.conf
familiasm-api.conf
file and configure it for your Apiato project. Replace the root
and server_name
directives as follows:server {
listen 80;
listen [::]:80;
server_name familiasm.local;
root /var/www/familiasm-api/public;
...
}
Open the .env
file in the Laradock directory and set the following Postgres settings:
POSTGRES_VERSION=15.0
POSTGRES_DB=your_database_name
POSTGRES_USER=your_user_name
POSTGRES_PASSWORD=your_password
Navigate to the familiasm-api
directory and create a .env
file by copying the .env.example
file.
cd ../../familiasm-api
cp .env.example .env
Edit the .env
file to set the DB_CONNECTION
settings:
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=your_database_name
DB_USERNAME=your_user_name
DB_PASSWORD=your_password
Navigate back to the Laradock directory and run the following command:
cd ../laradock
docker-compose up -d nginx php-fpm postgres workspace
Add an entry to your system's hosts file to map the familiasm.local
domain to 127.0.0.1
.
# On Linux and macOS
echo "127.0.0.1 familiasm.local api.familiasm.local" | sudo tee -a /etc/hosts
# On Windows
echo "127.0.0.1 familiasm.local api.familiasm.local" >> %SystemRoot%\System32\drivers\etc\hosts
Execute the following command to install the composer dependencies for your Apiato project:
docker-compose exec workspace bash -c "cd /var/www/familiasm-api && composer install"
Execute the following command to run the database migrations for your Apiato project:
docker-compose exec workspace bash -c "cd /var/www/familiasm-api && php artisan migrate"
If your Apiato project uses Laravel Passport, execute the following commands to set it up:
docker-compose exec workspace bash -c "cd /var/www/familiasm-api && php artisan passport:install"
You should now be able to access your Apiato application by visiting http://familiasm.local in your web browser.
That's it! You've successfully set up Laradock with Nginx, PHP-FPM (8.2), Apiato 11, Postgres 15, and a workspace. If you need to add more services or customize the configuration, you can do so by editing the .env
file in the Laradock directory and the docker-compose.yml
file as needed.
Todo: