This repo aims to create a one-stop script which would allow the setup of a MERN stack via multiple containers reliably.
- docker (with external network created)
- docker-compose
- wget
Tested working with Ubuntu 20.04
$ wget https://raw.githubusercontent.com/NanoCode012/docker-mern/main/setup-server.sh -O setup-server.sh
$ chmod +x setup-server.sh
$ ./setup-server.sh
Note: Ignore Git repo not initialized Error: Command failed: git --version
when creating base react files
barebone
run with default options and without creating react and node files
$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.http.yml up -d --build
Add -f docker-compose.ssl.yml
for SSL setup and remove -f docker-compose.http.yml
.
TIP: Make a bash file that runs the above for you. This functionality will be added later.
$ docker-compose up -d --build
- For more docker-configuration, consider creating a new compose file with the changes and adding it via
-f
option
Pass in environment variable BRANCH=the_branch_name
before calling script, so that the script knows where to wget
the files.
PRs are greatly appreciated, but please open an Issue first to discuss.
Questions? Open an Issue.