This is project will show you how to combine ReactJS and Golang into single container.
In the project I set default port is 8080. You can change it by set $PORT in your environment.
- With docker: You need installed
docker(if you are run it with docker) anddocker-compose(if you run it with docker-compose). I placed links tutorial in here (docker and docker-compose) - Without docker: You need install
go (>=1.14),nodejs (>= 12)andyarn.
docker build -t <you_choose_image_name>:<tag> .
docker run -d -p 8080:8080 <you_choose_image_name>:<tag> docker-compose up --build# You need to build `frontend` first
cd ./frontend
yarn build
# After this phase you will see a build folder inside current folder
cd ..
go mod download
go build -o app . && ./app