Giter Site home page Giter Site logo

inushin / dockernodessl Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 44 KB

This is a complete stack for running a projects with Node, MongoDB, NGINX and PHP into Docker containers using docker-compose tool and with Certbot for the HTTPS certificate.

License: GNU General Public License v3.0

Shell 72.46% Dockerfile 18.74% JavaScript 7.66% PHP 1.14%
docker mongodb nginx certbot certbot-ssl php74 php docker-compose

dockernodessl's Introduction

๐Ÿณ Docker + PHP 7.4 + MongoDB 4.4 + Nginx 15 + Certbot(HTTPS) + Node 13 ๐Ÿณ

NODE MONGO

If you find this useful, remember about giving a start โญ to this repo or share it ๐Ÿ”

Created from https://github.com/Inushin/dockerSymfonySSL

Description ๐Ÿ“‹

docker_facebook_share

This is a complete stack for running projects with Node, MongoDB, NGINX and PHP into Docker containers using docker-compose tool and with Certbot for the HTTPS certificate.

It is composed by 5 containers:

  • nginx, acting as the webserver.
  • php, the PHP-FPM container with the 7.4 PHPversion.
  • mongodb which is the MongoDB database container with a MongoDB 4.4 image.
  • node the Node container with the 13 Node version.
  • certbot generates the SSL certificate for your personal domain.

Installation โŒจ

Docker Installation Illustration

  1. You need Docker and Docker-compose where you are going to launch this so, if you do not have it... click HERE or go to the end of this .md ^^

  2. Clone this rep.

  3. Check that the dir. data/certbot/www/.well-known exist. If it is not, create it ๐Ÿ˜€.

  4. Edit init with your domain and an email.

  5. Edit the docker-compose.yml with your DB information.

  6. Edit data/nginx/node/index.js with your domain.

  7. Run ./init.

  8. Edit data/nginx/web.conf with your domain and your project dir.

  9. Run docker-compose down

  10. Run docker-compose up -d

  11. The 4 containers are deployed:

Creating docker_mongo_1   ... done
Creating docker_php_1     ... done
Creating docker_nginx_1   ... done
Creating docker_node_1   ... done
Creating docker-certbot-1 ... done

Docker's useful commands ๐Ÿ“‘

Docker Commands Illustration

  • Run Docker-compose: docker-compose up -d / docker-compose up

  • Check Docker-compose's volumens status: docker-compose ps -a / docker-compose ps

  • Check Docker's images: docker images -a

  • Remove Docker's images: docker rmi -f imageID1 imageID2 ... (-f = force)

  • Enter to a Docker's volumen: docker-compose exec VolumenID sh / docker-compose exec VolumenID bash

  • Copy a file to the docker we want to: docker cp file docker_id:/dir

  • See all the configuration of the docker-compose.yml with the paths completed: docker-compose config

  • See all the information of a volumen (interesting of IPs): docker inspect VOLUMEN_ID

  • Remove all dangling (not tagged or associated with a container) containers, volumes, networks and images: docker system prune

  • Remove all unused containers and images with at least one container associated to them: docker system prune -a

  • Shows all unused local images: docker images ls -f dangling=true

  • Shows all unused local volumes: docker volume ls -f dangling=true

  • Remove all local volumes not used by at least one container: docker volume prune

Installing Docker and Docker-compose ๐Ÿ› 

Docker-composer

Adjust the installation to your OS. Here you have the one for EC2(AWS) with CentOS

  • Docker installation
  1. Download and install Docker: yum install docker

  2. Gives permisions so you can run it everywhere: usermod -a -G docker ec2-user

  3. Starts Docker's service: service docker start

  4. Starts Docker's service each time you run the SO: chkconfig docker on

  • Docker-compose installation
  1. Download and install Docker-compose: curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

  2. Make it executable from anywhere: chmod +x /usr/local/bin/docker-compose

  3. Makes an direct access for docker-compose: ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

  4. Check the version and the installation: docker-compose --version

โญ Feedback and bugs ๐Ÿž

If you find any bug or just want to give your feedback (remember the โญ ^^), Feel free to do it. I am, as you, constantly learning and things change so quickly that... no one knows ^^

Version control ๐Ÿ“

  • 0.0.0 - Creation of the rep with the config finished - 26/01/2022
  • 0.0.1 - Updated useful Docker commands - 10/02/2022

dockernodessl's People

Contributors

inushin avatar

Stargazers

 avatar

Watchers

 avatar

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.