Deployment
Reid H edited this page Dec 14, 2023
·
3 revisions
This document provides an overview of the deployment process for Market Mock. We utilize Docker, nginx, and other tools for a consistent and scalable production deployment.
- Docker Containerization
- nginx Configuration
- Hosting and Domain
- Backend and Frontend Configurations
- Deployment Steps
Docker is our chosen tool for containerization. We use three distinct Docker images:
- Frontend: Custom image based on our React code.
- Backend: Custom image based on our backend.
- MySQL: A third-party Docker image prepared for MySQL 8.
This approach ensures consistency and isolation of each application component.
Our nginx setup handles:
- Reverse Proxy: Routing traffic to the correct container.
- SSL: Managing SSL certificates and secure connections.
- HTTPS Redirecting: Ensuring all connections use HTTPS.
- Hosting: We're hosted on a VPS provided by RackNerd.
- Domain: Currently managed by Google but transitioning to Squarespace due to external circumstances.
-
Backend: Configurations get overwritten during deployment. This setup allows developers to use development configurations without repercussions.
-
Frontend: React's build process includes configurations. Hence, during frontend builds, developers should use production configurations.
- Set the client config to production. Server URL:
https://marketmock.app
. - Build both the frontend and backend Docker images:
docker-compose build
- Save both the front and backend Docker images:
docker save -o market-mock_backend.tar market-mock_backend:latest
docker save -o market-mock_frontend.tar market-mock_frontend:latest
- Transfer these images to the RackNerd VPS.
- Load the docker images onto the VPS:
docker load -i ./market-mock_backend.tar
docker load -i ./market-mock_frontend.tar
- Initiate the deployment:
docker-compose up