Create a Pull Request from main branch to deploy branch, and merge it. Once you merge it, the GitHub Action will run to build and deploy the new version at simplemeal.live.
Install Docker Desktop
Pull the source code Simple Meal
If pulled for the first time or the package.json changed run
docker compose build --pull --no-cache
Then, run the following command to start the environment.
docker compose up -d
open your web browser and navigate to the app
view the logs from the app continer
docker compose logs -f app
view the logs from the postgres db continer
docker compose logs -f db
connect to the terminal inside the db container
docker compose exec -it bash
psql -d simple_meal -U postgres
stop the containers
docker compose down
AND
removing docker volume
docker volume rm simple-meal_postgres_data
Go to docker database container and open Terminal
psql -d postgres -U postgres
Go into our Database:
\c simple_meal
OR
docker exec -it simple-meal-db psql -d simple_meal -U postgres
Install the extensions required to connect to the container through VSCode by following these steps:
- Open the workspace folder in VS Code.
- Go to the Extensions view (Ctrl+Shift+X).
- In the search bar, type @recommended:workspace.
- This will filter extensions recommended for the current workspace.
- Click the "Install" button next to each extension, or click the cloud icon at the top to install all recommended extensions at once.
- Open the terminal in VS Code and start the container using the instructions above.
- Once the container is running, click the "Open Remote Window" button on the bottom-left of the window.
- Select "Attach to running container".
- Select the container that you just started.
- Start coding as you would normally do. The React app will be running in the background, you can reach is via
http://localhost:[port]
.