c57d4bac5720fcd90ed404cd4f04cd0e00b78292
- Dockerfile: add composer/npm build, proper entrypoint, fix EXPOSE port - docker-compose: fix postgres volume path, add healthchecks, use named volume - Add entrypoint.sh for auto migrations and dependency install at startup - Update .gitignore to exclude Firebase credentials, DB files, logs - Update .env.example with all required variables for Docker deployment Application-level fixes (applied to src/ which is gitignored): - RainfallController: parameterized SQL queries (was SQL injection) - WaterLevelController: parameterized queries + fix broken WHERE clause - DatabaseSeeder: env-based admin password instead of hardcoded 'password123' - Migration 2025_12_11: removed duplicate admin user creation - AlertController: FCM topic routing by stationtype+level (was hardcoded) - sidesdecode.py: env vars for credentials, fix water level stationtype bug (1→2)
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, copy
.env.exampleto.env - Execute the following command for create application
$ make create-project
- Next, set environment DB for app laravel in
src/.envvariable :
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=<your_db_name> // same in root .env variable POSTGRES_DB
DB_USERNAME=<your_db_user> // same in root .env variable POSTGRES_USER
DB_PASSWORD=<your_db_password> // same in root .env variable POSTGRES_PASSWORD
- show application in http://localhost:85
- show adminer in http://localhost:8080
- show pgadmin in http://localhost:5050
- list execute command in Makefile.
Container details :
appuse image:webuse image:- nginx:stable-alpine
dbuse image:- postgres:15
admineruse image:- adminer:latest
Optional
pgadminuse image:- pgadmin:latest
Description
Languages
Python
79%
Makefile
10.8%
Dockerfile
7.2%
Shell
3%
