b34e55679883fcf7c6573818e9b215f60750ab4c
Laravel using PostgreSQL in Docker
Introduction
Build a simple laravel application development environment with docker compose.
Requirement
- Docker ^19.*
Installation
- Git clone & move to working directory
- Settings your credentials docker compose using Docker Secrets
-
Create credentials for DB Name
$ echo "<your_db_name>" | docker secret create app_db_name - -
Create credentials for DB User
$ echo "<your_db_user>" | docker secret create app_db_user - -
Create credentials for DB Password
$ echo "<your_db_password>" | docker secret create app_db_password -
Optional credentials
If you want to use pgAdmin management add this credentials:
-
Create credentials for pgAdmin Password
$ echo "<your_pgadmin_password>" | docker secret create app_pgadmin_password -
Uncomment in top level secret for pgAdmin in file docker-compose.yml to:
app_pgadmin_password:
external: true
- Execute the following command for create application
$ make create-project
- set src/.env variable :
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=<your_database>
DB_USERNAME=<your_username>
DB_PASSWORD=<your_password>
- show application in http://localhost:85
- show adminer in http://localhost:8080
- list execute command in Makefile.
Container details :
Description
Languages
Python
79%
Makefile
10.8%
Dockerfile
7.2%
Shell
3%
