nurseybushc / VitaDB

Online database for PSVITA homebrews and plugins. (https://vitadb.rinnegatamante.it)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Todo

PHP

  • Change unnecessary posts to gets - this would break the api i guess
  • Reduce js files
  • One php database connect file instead of in every file
  • Bootstrap native to remove jquery - it's in everything so probably not
  • make models for json returned from db

MYSQL

Notes

https://hub.docker.com/r/trafex/alpine-nginx-php7/ Dockerize a PHP application

Run just docker image docker run -p 80:8080 -v ~/path_to_VitaDB:/var/www/html trafex/alpine-nginx-php7

docker-compose startup with Makefile make start

.env in docker-compose
https://docs.docker.com/compose/environment-variables/#the-env-file

env vars in php https://mediatemple.net/community/products/grid/204643130/using-environment-variables-in-php

create env vars in docker container from docker-compose.yml

follow docker logs for a service with name docker logs vitadb_webapp_1 -f

connect to mysql docker container from outside docker compose network

mysql -P 9906 --protocol=tcp -u root -p
mysql -P 9906 --protocol=tcp -u devuser -p

show databases;
show tables;

separating nginx out of php-fpm container

this is the default.conf is what made index.php work at http://localhost

...  
index index.php index.html;

location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to index.php
    try_files $uri $uri/ /index.php?q=$uri&$args;
}
...

to get a shell in docker container
docker exec -it CONTAINER_ID /bin/sh

user's passwords are stored unecrypted

there are no joins, i think this could be nosql

init mysql db with script https://stackoverflow.com/questions/29145370/how-can-i-initialize-a-mysql-database-with-schema-in-a-docker-container

https://medium.com/better-programming/customize-your-mysql-database-in-docker-723ffd59d8fb

docker exec -it mysql /bin/sh
mysql -u root

to delete and recreate database portion every time, in Makefile as part of stop command:
rm -rf db_data

About

Online database for PSVITA homebrews and plugins. (https://vitadb.rinnegatamante.it)


Languages

Language:PHP 36.1%Language:JavaScript 30.1%Language:CSS 18.9%Language:Hack 7.7%Language:HTML 6.9%Language:TSQL 0.3%Language:Makefile 0.0%Language:Dockerfile 0.0%