https://github.com/neilkuan/example-go-http
https://github.com/neilkuan/example-go-http
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/neilkuan/example-go-http
- Owner: neilkuan
- Created: 2023-12-09T12:37:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T01:10:31.000Z (over 1 year ago)
- Last Synced: 2025-03-29T02:38:26.224Z (2 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example go http project
> For create go http server.### Binary build
```bash
CGO_ENABLED=0 GOOS=linux go build -o workerCGO_ENABLED=0 GOOS=linux go build -o backend
CGO_ENABLED=0 GOOS=linux go build -o frontend
```### Container Image build
```bash
docker build -f Dockerfile.worker -t ghcr.io/neilkuan/example-go-http:worker .docker build -f Dockerfile.frontend -t ghcr.io/neilkuan/example-go-http:frontend .
docker build -f Dockerfile.backend -t ghcr.io/neilkuan/example-go-http:backend .
```### Deploy to kubernetes from ghcr.io
```bash
kubectl create deploy worker --image ghcr.io/neilkuan/example-go-http:worker --port=8080
kubectl create deploy frontend --image ghcr.io/neilkuan/example-go-http:frontend --port=8080
kubectl create deploy backend --image ghcr.io/neilkuan/example-go-http:backend --port=8080
```