teleport-interview
Repository for the Gravitational fullstack challenge
Requirements and Certificate Setup
mkcert
This project relies on self-signed certificates, which can cause your browser to complain at you and other minor annoyances. A simple tool for solving this is mkcert, which creates a local CA that your browser will trust and uses it to sign subsequently generated certificates. Install mkcert
, and then navigate to the certs/
directory and generate a certificate and key for the app by running
# cd certs/
mkcert -key-file localhost.key -cert-file localhost.crt 0.0.0.0 localhost 127.0.0.1 ::1
Docker
This project is built and tested with Docker and Docker Compose (20.10
/1.27
)
Development
Build the development Docker images by running
# Uncomment --no-cache below if you've made any changes to the relevant Dockerfile's
docker-compose -f docker-compose-dev.yml build #--no-cache
and run them by running
docker-compose -f docker-compose-dev.yml up
This will start a hot-reload webpack development server serving the React app running on port 8080 and a hot-reload go server running on port 8000. Access the app in the browser by navigating to https://0.0.0.0:8080/.
Production
Build the production Docker image by running
docker-compose -f docker-compose-prod.yml build
and run it by running
docker-compose -f docker-compose-prod.yml up
This will start a go server exposed over port 8000 serving the React app and go api. Access the app in the browser by navigating to https://localhost:8000/.