Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 2.22 KB

Deploy.md

File metadata and controls

44 lines (36 loc) · 2.22 KB

Deploy CMS

About Cybersecurity

❗ Cybersecurity is a cornerstone of any development. Ensuring the integrity, availability, and security of services, as well as protecting customer and their data, is mandatory. While this repository provides guidelines to reduce the attack surface, it's impossible to guarantee 100% system security. Continuous learning and the implementation of a secure software development lifecycle are highly recommended.

Ubuntu Server Setup and Hardening

Docker Setup and Hardening

Nginx Setup and Hardening

Steps to download and run Application

  1. Clone repo git clone https://github.com/glp-92/FullStack_CMS.git

  2. ⚠️ .env and config files are gitignored but .example.env files are provided to see the configuration. These files must be renamed and configured as needed (ip, ports...)

    • ./.example.env => ./.env.production
    • ./frontend/clientapp/.example.env => ./frontend/clientapp/.env.production

    Info about environment in this project

  3. Generate initdb file for mysql setup which will create all users, databases and permissions needed

    • On local computer
    export ENV_FILE=.env.production # change with custom env files
    mkdir ./backend/mysql/initdb
    bash ./backend/mysql/generate_initdb.sh
    • If using ssh on a remote server, for security reasons (visit ssh hardening section) it's recommended to manually create initdb file with own mysql data that matches env file
  4. Generate jar file from Springboot Blog Service

    sudo apt reinstall openjdk-17-jdk # If in a VM for deploy
    cd backend/blog-service
    ./mvnw clean install -DskipTests # with ls a mvnw file should be placed, will test with database so if it's not installed, skip it
    
  5. Generate ssl certificates (currently self-signed)

    cd backend/auth-service/certs
    bash generate_certs.sh
    cd ../../..
    cd frontend/reverse-proxy/certs
    bash generate_certs.sh
  6. docker compose --env-file ./.env.production up --build

  7. Go to browser and check urls https://localhost https://server-ip ...