nik2208 / php-crud-api-quick-start

A ready to go, customizable, docker stack for PHP-CRUD-API
5 stars 0 forks source link

api.php gets overwritten every time you down/up #4

Open blungu opened 3 days ago

blungu commented 3 days ago

https://github.com/nik2208/php-crud-api-quick-start/blob/3fe5ae4f444c1f1079bf6d23b28acdc106dbb4b3/docker-compose.yml#L48

You could test if file exists before downloading it:

/bin/bash -c 'if [ ! -f /var/www/html/api.php ]; then curl -o /var/www/html/api.php https://raw.githubusercontent.com/mevdschee/php-crud-api/main/api.php && echo "downloaded api.php"; else echo "api.php is already there, will NOT overwrite"; fi'

Or you could replace the variables every time you download it

nik2208 commented 3 days ago

the intent is to get the latest version of the api.php file. this is a quick start project, to get a backend up and running in seconds. What could be implemented is appending parameters from an env file at the end of api.php to keep the customizations