Skip to content

Deployment

Reid H edited this page Dec 14, 2023 · 3 revisions

Market Mock Deployment Guide

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.

Table of Contents

Docker Containerization

Docker is our chosen tool for containerization. We use three distinct Docker images:

  1. Frontend: Custom image based on our React code.
  2. Backend: Custom image based on our backend.
  3. MySQL: A third-party Docker image prepared for MySQL 8.

This approach ensures consistency and isolation of each application component.

nginx Configuration

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 and Domain

  • Hosting: We're hosted on a VPS provided by RackNerd.
  • Domain: Currently managed by Google but transitioning to Squarespace due to external circumstances.

Backend and Frontend Configurations

  • 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.

Deployment Steps

  1. Set the client config to production. Server URL: https://marketmock.app.
  2. Build both the frontend and backend Docker images: docker-compose build
  3. 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
  4. Transfer these images to the RackNerd VPS.
  5. Load the docker images onto the VPS: docker load -i ./market-mock_backend.tar docker load -i ./market-mock_frontend.tar
  6. Initiate the deployment: docker-compose up