docker network create -d bridge demo_1
docker run -d --name nginx_demo_1 --network demo_1 -it -p 8080:80 nginx
configure
events {}
http {
server {
listen 80;
location / {
proxy_pass http://demo_1_api;
}
}
}
docker run --name demo_1_mysql --network demo_1 -e MYSQL_ROOT_PASSWORD=*password* -d mysql
for simple DB manegment you can run phpmyadmin:
docker run --name phpmyadmin -d -e PMA_HOST=demo_1_mysql --network demo_1 -p 8080:80 phpmyadmin
- create db named
main
- create 2 tables:
user (id (auto increment), date_insert (CURRENT_TIMESTAMP), date_update (CURRENT_TIMESTAMP), phone, password_hash),
user_token (id (auto increment), date_insert (CURRENT_TIMESTAMP), date_update (CURRENT_TIMESTAMP), user_id, token, expires)
you need to create in root folder file named secrets.txt
and put password, that you entered in last step
chmod +x build.sh
./build.sh
now, nginx running on localhost:8080
. If not, try restarting nginx