NirajD10 / pureplantparadise

An E-commerce indoor plant selling site using MERN Stack
https://pureplantparadise.netlify.app/
4 stars 0 forks source link

Dockerize application #4

Open KrystianOg opened 4 months ago

KrystianOg commented 4 months ago

Create docker-compose file which includes mongo image + some admin panel image (optional but desirable) and of course include images for frontend and backend projects, both can be defined within Dockerfile(s) and referenced from docker-compose later

create .env.local file in root of your application this is where you keep your secrets, create .env.example which includes needed environment variables but with empty values

add .env.local to gitignore so you don't commit secrets I like to do it this way

.env
.env*.local
!.env.example

first line ensures that if you created simple .env file it is also ignored, only .env.example should be committed and it is forcibly not ignored on line 3 on 2nd line we ignore any .env.local files like, .env.development.local .env.staging.local .env.production.local cause you may want to include different environment variables based on enviroment

NirajD10 commented 1 month ago

I added Dockerfile on each server and client folder. Please check it.