This is a personnal project, I made this for learning bash scripting and have deeper knowledges with docker. And also for my personal usage for deployement.
I wanted to be able to deploy quickly and securly any API or frontend with simple conf file.
This is thinked for nodeJS backend and postgresql or mongodb database and optionnaly with redis database for caching.
I also add optionnal modules
sqitch
if you want to deploy fresh relational database without any data but ready structureseeding
if you aldreay have an backup file of your databasescheduled backups
with cron- send over
ssh
your backups to another sever (usingrsync
)
It's my first bash script, so it's not perfect at all !
Docker | Bash | NodeJS |
---|---|---|
Redis | MongoDB | Postgresql |
Sqitch |
- ubuntu 21.04
- debian 10
- macos BigSur (you need to have homebrew installed to be able to install coreutils and gnu_sed)
I also test on cloud with debian 10 vm with linode
- docker
$ curl -fsSL https://get.docker.com -o get-docker.sh $ sudo sh get-docker.sh $ sudo usermod -aG docker ${USER} $ sudo systemctl enable docker
- docker-compose
$ sudo apt-get install libffi-dev libssl-dev $ sudo apt install python3-dev $ sudo apt-get install -y python3 python3-pip $ sudo pip3 install docker-compose
- api files/folder must be in
automated-docker-deployment/api
folder - frontend build files must be in
automated-docker-deploymentfront/build
folder
- Populate config.sh file, there is a lot of comments in this file for help
- Be in
automated-docker-deployment/docker
folder and type
bash automated-docker-deploy.sh
or
sudo bash automated-docker-deploy.sh
in case of your docker installation need sudo
- Setup main script
- Have separation of concerns (with separated conf file)
- Add sqitch module
- Add seeding module
- Add backup module
- Add ssh module
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Jerome Karabenli - contact@jkarabenli.dev
Project Link: https://github.com/jerome-karabenli/automated-docker-deployement
Just be careful with .dockerignore
file, not forgot to adapt it for your usage.