This project demonstrates a multi-stage Docker setup for a React application served with Nginx, alongside running Adminer and PostgreSQL in a Docker Compose environment. It includes instructions on how to set up and run the application.
sample/
├── backend/
│ ├── app.js
│ ├── Dockerfile
│ ├── package.json
│ └── package-lock.json
│
├── web/
│ ├── public/
│ ├── src/
│ ├── Dockerfile
│ └── nginx.conf
│
├── docker-compose.yml
├── README.md
└── .env
- Docker
- Docker Compose
- Node.js
- Coder VM server
- Github Action
git clone https://github.com/m4rrypro/SampleTest.git
cd sample
Create a .env file in the root directory with the following variables:
- DATABASE_URL
- PORT
- REACT_APP_API_URL
Ensure Docker and Docker Compose are installed and running on your system. Then, run the following command to build and start the services:
docker-compose up --build
- React App: https://localhost:80
- Adminer: https://localhost:8081
- Backend API: https://localhost:4000
To run migrations for the backend, use the docker exec
command to access the backend container and run your migration script.
The automation process for this project ensures that the application is continuously deployed and tested. Here is an overview of how it works:
- GitHub Actions are used to automatically build and test the application whenever changes are pushed to the repository.
- The workflow files are located in the
.github/workflows
directory.
- Upon successful CI, the application is deployed to a development environment using Coder.
- The output link for the deployed application is: Live Preview
Feel free to fork this project, make improvements, and submit pull requests. Any contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.