Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 1.42 KB

README.md

File metadata and controls

72 lines (45 loc) · 1.42 KB

OneBook Front-end

Onebook is a website allowing artists to publish their work and create their online "book".

Run Locally

The backend need to be started before

npm start

Run in a Kubernetes Development Cluster

Prerequisites

  • Kubernetes distribution (examples: k3s or minikube)
  • Kubectl CLI
  • Docker

Start the application

The backend need to be started first.

  1. 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
  1. Add your custom image to the k3d cluster
k3d image import onebook-frontend:dev -c onebook
  1. 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

Clean

To clean the Kubernetes dev namespace:

kubectl delete -f infra-as-code/

Schema of the global application running on Kubernetes

dev infrastructure