popsenzawa-echo icon indicating copy to clipboard operation
popsenzawa-echo copied to clipboard

Step to step guide on setting up go server

Open theblackcat102 opened this issue 4 years ago • 4 comments

Not sure if this is the best format for submitting a minimal setup guide, if @supersonictw thinks it's not appropriate then I will close it anyway

Required docker images:

Popcat server require redis for cache and mysql for stats aggregation so you will these image other than the popcat image.

docker pull supersonictw/popcat-echo
docker pull redis
docker pull mysql:5.7
docker run -p 6379:6379  -d redis:latest
docker run -p 3306:3306 -e  MYSQL_ROOT_PASSWORD=<Your password> -d mysql:5.7

Setup MYSQL

Use the initialize.sql script to setup your MYSQL database schema. You may need to connect to your database before this.

Execute image

Setup docker environment variable file according to .env.sample

I find this DSN format working under my own setup ( under Linux environment you will need to change docker.for.mac.localhost to the docker IP )

MYSQL_DSN=<mysql user>:<password>@tcp(docker.for.mac.localhost:3306)/<your database name>?charset=utf8

Execute popcat server

docker run -p 8013:8013 --env-file <your environment variable file> supersonictw/popcat-echo

You should be able to access popcat server at localhost:8013 !

theblackcat102 avatar Aug 21 '21 17:08 theblackcat102

Excellent! Thank you for your contribution.

By the way, there are some scripts available on https://github.com/supersonictw/popcat-echo_deploy.

supersonictw avatar Aug 22 '21 02:08 supersonictw

Hi, I'm really new to databases. Can you explain more details on how to create, connect to the database, deploy the script and DSN, .env kinda stuff? Thanks in advance!

there are some scripts available on https://github.com/supersonictw/popcat-echo_deploy.

By the way, the deploy script is not working for me, what am I missing? It's showing a ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO) error. Seems like it can't understand the $MARIADB_... variables.

F-fengzi avatar Aug 23 '21 06:08 F-fengzi

Hi, I'm really new to databases. Can you explain more details on how to create, connect to the database, deploy the script and DSN, .env kinda stuff? Thanks in advance!

there are some scripts available on https://github.com/supersonictw/popcat-echo_deploy.

By the way, the deploy script is not working for me, what am I missing? It's showing a ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO) error. Seems like it can't understand the $MARIADB_... variables.

I'm sorry too late for replying, I was so busy on improving the example of web client. I write down an article on https://medium.com/@supersonictw/to-create-the-server-of-a-popcat-like-game-128b0fd82a58 You can follow it to create your own popcat-like games.

supersonictw avatar Aug 27 '21 17:08 supersonictw

It didn't work but still thank you! ~~We solved it by making our own backend lol~~

F-fengzi avatar Aug 31 '21 00:08 F-fengzi

The application already refactor, so the guide might be not working. The new one is here.

git clone https://github.com/supersonictw/popsenzawa-echo-deploy.git
cd popsenzawa-echo-deploy
sh initialize_mmdb.sh
docker-compose up -d

supersonictw avatar May 20 '24 14:05 supersonictw