https://github.com/x00real/go-n-reactjs
This is a sample project help you combine go (Echo) and ReactJS
https://github.com/x00real/go-n-reactjs
docker echo echo-framework golang reactjs
Last synced: 6 months ago
JSON representation
This is a sample project help you combine go (Echo) and ReactJS
- Host: GitHub
- URL: https://github.com/x00real/go-n-reactjs
- Owner: x00real
- Created: 2020-12-30T02:56:07.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T06:25:01.000Z (almost 5 years ago)
- Last Synced: 2025-06-04T06:34:45.741Z (7 months ago)
- Topics: docker, echo, echo-framework, golang, reactjs
- Language: Go
- Homepage: https://go-and-react.herokuapp.com
- Size: 391 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Combine Golang (echo) and ReactJS into single docker container
This is project will show you how to combine ReactJS and Golang into single container.
## Usage
In the project I set default port is `8080`. You can change it by set `$PORT` in your environment.
### Prerequisite
* **With docker:** You need installed `docker` *(if you are run it with docker)* and `docker-compose` *(if you run it with docker-compose)*. I placed links tutorial in here ([docker](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04) and [docker-compose](https://docs.docker.com/compose/install/))
* **Without docker:** You need install `go (>=1.14)`, `nodejs (>= 12)` and `yarn`.
### With `docker`
```shell
docker build -t : .
docker run -d -p 8080:8080 :
```
### With `docker-compose`
```shell
docker-compose up --build
```
### Without `docker`
```shell
# 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
```