Docker image for auto-recompiling and auto-restarting Golang server application
OTHER License
Place docker-compose.yml in your project root and run docker-compose up --build
.
version: '3.8'
services:
myservice:
image: acim/go-reflex
environment:
- RACE_DETECTOR=1
volumes:
- .:/app
ports:
- 3000:3000
Note: Replace port number with correct port number of your application.
version: '3.8'
services:
myservice:
image: acim/go-reflex
environment:
- RACE_DETECTOR=1
- BUILD_ARGS=./cmd/server/server.go
volumes:
- .:/app
ports:
- 3000:3000
version: '3.8'
services:
myservice:
image: acim/go-reflex
environment:
- RACE_DETECTOR=1
- APT_INSTALL=libraw-dev
volumes:
- .:/app
ports:
- 3000:3000
go install sigs.k8s.io/kind@latest
kind create cluster --config=config.yaml
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraMounts:
- hostPath: /path/to/your/project/root
containerPath: /app
kubectl apply -f deploy.yaml
apiVersion: v1
kind: Pod
metadata:
name: your-app-name
namespace: default
spec:
containers:
- image: acim/go-reflex
name: your-app-name
env:
- name: RACE_DETECTOR
value: '1'
volumeMounts:
- mountPath: /app
name: app
restartPolicy: Never
volumes:
- hostPath:
path: /app
name: app
kubectl port-forward your-app-name 3000:3000
Note: Replace port number with correct port number of your application.