Onebook is a website allowing artists to publish their work and create their online "book".
The backend need to be started before
npm start
- Kubernetes distribution (examples: k3s or minikube)
- Kubectl CLI
- Docker
The backend need to be started first.
- Build and test the onebook-frontend image with Docker
# get the backend service external IP
kubectl get services -n dev
docker build --build-arg REACT_APP_API_URL=http://<backend-service-external-ip>:4000 -t onebook-frontend:dev .
docker run --rm --name onebook-frontend -p 3000:3000 onebook-frontend:dev
# access the application
curl http://localhost:3000
docker stop onebook-frontend
- Add your custom image to the k3d cluster
k3d image import onebook-frontend:dev -c onebook
- Deploy the application
kubectl apply -f infra-as-code/
# verify the deployment
kubectl get deployments -n dev
# verify the service and get its external IP
kubectl get services -n dev
# access the application
curl http://<service-external-ip>:3000
To clean the Kubernetes dev namespace:
kubectl delete -f infra-as-code/