Giter Club home page Giter Club logo

infra-setup's Introduction

Before you start

Ansible logo

You need to first install Ansible on your local machine in order to execute ansible playbooks. Please use the following link to install Ansible: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installation-guide

Current architecture

Application server plan
Diagram link: https://miro.com/app/board/uXjVK9rVdAM=/

We have a single server setup. This server uses Nginx and Docker. Each application runs as a container within Docker. Additionally, all application dependencies, such as PostgreSQL, Elasticsearch, and Redis, are also run as containers inside Docker.

How to setup the application server?

... To be written

Remove Backport Repositories

Backport repository is not needed for our installation. For this reason, we are going to remove these repositories from apt sources.

ansible-playbook playbook/remove_repositories.yaml -i inventory.yml

Install Docker

In order to run our applications, we need to have a docker installed in out system.

ansible-playbook playbook/install_docker.yaml -i inventory.yml

Install Nginx and configure SSL certificates with Certbot

In order to serve our applications to visitors, we are using nginx as a web server.

ansible-playbook playbook/100-nginx.yaml -i inventory.yml

Create an app user and add to Docker group

Our docker containers do not run as a root, they run under the user app. This user is added to the docker group.

ansible-playbook playbook/create_user.yaml -i inventory.yml

How can I add a new domain?

  • Open playbook/nginx.yaml file in your editor.
  • Find the variables in the find, it should look like this:
  vars:
    nginx_sites:
      - server_name: pazl.dev
        admin_email: [email protected]
        apps:
          - location: /password
            proxy: http://127.0.0.1:8000
  • Then modify it according to your needs.
  • After your modifications, you can run the following command in order to apply them.
ansible-playbook playbook/nginx.yaml -i inventory.yml

How can I install MySQL service in Docker?

  • Open playbook/mysql_docker_playbook.yaml file in your editor.
  • Adjust the mysql version according to your needs.
ansible-playbook playbook/mysql_docker_playbook.yaml -i inventory.yml

infra-setup's People

Contributors

bnymn avatar

Watchers

 avatar

infra-setup's Issues

Preventing port scan in the load balancer

The load balancer is open to the internet. There are only three ports available, which are 80, 443, and 63254.

We would like to prevent port scanning, and block all IP addresses permanently, if there is any connection request sent to any port other than these three.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.