Simple NodeJS REST Application with some patterns
Please define your variables in .env
according to .env.example
npm run dev
# Don't forget to set the DB_* parameters and start the postgres
# Development build
npm run build:dev
docker compose -f Development.docker-compose.yml up -d
# For cleaning: docker compose -f Development.docker-compose.yml down -v
npm run build
# Production build
npm run build
# Generate SSL certificate
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 > cert_priv.pem
openssl req -x509 -key cert_priv.pem > cert.pem
# Run with compose
docker compose -f Production.docker-compose.yml up -d
# For cleaning: docker compose -f Production.docker-compose down -v
# For minikube activate environment
eval $(minikube -p minikube docker-env)
# Generate SSL certificate and private key file like above
# Build production image
docker build -f Production.dockerfile . -t todo-list \
--build-arg="CERT_FILE_PATH=cert.pem" \
--build-arg="PRIVKEY_FILE_PATH=cert_priv.pem"
# Apply k8s configuration
# Create a PV
kubectl apply -f deploy/data-pv.yml
# Create a PVC
kubectl apply -f deploy/data-pvc.yml
# Run Postgres with HELM
# Update deploy/postgre-values.yml for your needs
helm install db -f deploy/postgre-values.yml bitnami/postgresql
# Create the Deployment
kubectl create -f deploy/todo-list.yml
# Get minikube ip address
minikube ip
# Test it
curl -k -X GET https://<minikube-ip-address>:30100/todo
Only integration tests are available. For running integration tests:
./scripts/integration-test.sh
npm run lint
docker compose -f Development.docker-compose.yml up db -d
psql -h localhost -U <username> <db>