Skip to content

Este repositorio tiene como objetivo documentar, estandarizar y automatizar el despliegue del proyecto Smart-Shell ( Facturador Electronico ), integrado por cinco repositorios independientes en un mismo servidor.

License

Notifications You must be signed in to change notification settings

luis122448/smart-shell-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo del Projecto

Deploying Docker Containers with Bash Scripts

Its repository contains the scripts necessary to automate the deployment of the Smart-Shell project, which is integrated by five independent repositories in the same server.

The automation includes the configuration of the environment variables, cloning of repositories, generation of SSL certificates, configuration of the Nginx server (Reverse Proxy) and finally the continuous development/deployment.

Repositorys

Principal Repository

Relational Repositorys

Installation

  1. Create a new directory

        sudo mkdir /var/www/smart-shell
    
        sudo mkdir /var/www/smart-shell/configurations
  2. Change the owner of the directory

        sudo chown -R $USER:$USER /var/www/smart-shell
  3. Clone the repository

        cd /var/www/smart-shell/configurations
    
        git clone git@github.com:luis122448/smart-shell-bash.git
        git clone https://github.com/luis122448/smart-shell-bash.git
  4. Define the environment variables

    First, define the IP address of the server for $SERVER_LOCAL_HOST variable:

        ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' 

    Then, define the environment variables in /etc/environment:

        sudo nano /etc/environment
        SERVER_LOCAL_HOST=
        SERVER_LOCAL_USER=
        DATABASE_USERNAME=
        DATABASE_PASSWORD=
        SMART_SHELL_POSTGRES_PORT=10001
        SMART_SHELL_REDIS_PORT=10002
        SMART_SHELL_MONGO_PORT=10003
        SMART_SHELL_SPRINGBOOT_PORT=10004
        SMART_SHELL_ANGULAR_PORT=10005

    Charge the environment variables:

        source /etc/environment

    Nota: The password defined in the DATABASE_PASSWORD variable will be used for the configuration of all databases.

  5. Execute the installation script

        bash install.sh
  6. Verify the installation

        tree /var/www/smart-shell/deployments
    
        /var/www/smart-shell/deployments
        ├── smart-shell-postgres
        ├── smart-shell-redis
        ├── smart-shell-mongo
        ├── smart-shell-springboot
        ├── smart-shell-angular
        └── ...

Local Development

  1. Execute the deployment script

        bash deploy.sh
  2. Verify the deployment

        sudo docker ps

Production Deployment

  1. Generate the SSH certificates and configure the NGINX server

    Review the file ./scripts/ssh/README.md to generate the SSH certificates according to the domain to be used for the Back and Front. Additionally, review the instructions in ./scripts/proxy/README.md for the configuration of the NGINX server.

        smart-shell-bash/
        ├── scripts/
        │   ├── ssh/
        │   │   ├── README.md
        │   │   └── ...
        │   ├── proxy/
        │   │   ├── luis122448.com.conf ( Front )
        │   │   ├── luis122448.dev.conf ( Back )
        │   │   ├── options-ssl-nginx.conf
        │   │   ├── README.md
        │   │   └── ...
        │   └── ...
        └── ...

Contributing

All contributions are welcome. For more information, please refer to the CONTRIBUTING file.

License

Its project is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 License.

About

Este repositorio tiene como objetivo documentar, estandarizar y automatizar el despliegue del proyecto Smart-Shell ( Facturador Electronico ), integrado por cinco repositorios independientes en un mismo servidor.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages