This repository is designed to enable your local device to act as a cloud service, allowing it to host multiple Docker containers that can be accessed externally. It applied cloudflare tunnel service to transfer any request from outside to your device safely and esaily. It also provided a list basic frameworks docker containers setup shell script, allowing people deploy their frameworks which can be accessed within one line command!
- The cost of cloud services - transfer the cloud services to local machine.
- Safety problems and maintenance of external requests to local device - container environment are isolated.
- Difficult to deploy and port the development environment - One command shell script to set up docker container.
To get started with using this repository, follow the instructions below:
Before you can deploy your local device as a cloud service, ensure that you have the following prerequisites installed:
- Docker: Install Docker
- Docker Compose: Install Docker Compose
- Domain name: Get one domain name
- Unix like terminal: Mac, WSL, Linux, ect.
- Cloudflare account: To setup your domain name, and use their tunnel service in their zero trust service. cloudflare | Zero trust
This repo suppose you already set up domain name and actived zero turst service in cloudflare account. To deploy your local device as a cloud service, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/zz9tf/MyDevice2external.git
-
Navigate to the cloned repository:
cd my-device-to-external
-
Set up cloudflare tunnel service
-
a. Set up
.env
file in the root folder.TUNNEL_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
It should be something like this. You can get your token in cloudflare account.
-
b. Directlly run docker-compose.yml to deploy cloudflare tunnel service by commands:
docker-compose up -d
Now, your tunnel service already finished. Feel free to create more containers to connect the network deploy in previous docker-compose.yml, and then these containers can be accessed externally.
You can run them in your github project folders, and then anything you developed in these folders can be accessed outside.(api service, webpages, etc.)
-
Express backend with nodemon and babel.js
./setup-express.sh
-
Django framework with requirments.txt file
./setup-django.sh
-
React typescript framework with nodemon.
./setup-reactTs.sh
-
SSH framework.
./setup-SSH.sh
More details in connectLocalDriveWithSSH
If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository on GitHub.
- Create a new branch with a descriptive name for your feature or bug fix.
- Make the necessary changes in your branch.
- Commit and push your changes to your forked repository.
- Submit a pull request to the main repository, explaining the changes you have made.
Please ensure that your contributions align with the coding standards, best practices, and guidelines defined in this repository.
This project is licensed under the MIT License. Feel free to modify and distribute it as per your needs.
This project makes use of the following open-source tools and libraries:
- Docker: https://www.docker.com/
- Docker Compose: https://docs.docker.com/compose/
I would like to express my gratitude to the developers of these fantastic tools for their contributions to the open-source community.
For any questions, suggestions, or issues, please feel free to contact the project maintainers.
You can also open an issue in the GitHub repository for bug reports or feature requests.
Happy cloud hosting!