List the ready features here:
- mongo db Database and data type,mongoose orm
- Node js crud process and real time application with socket io npm
- React, redux
- redis cache and session storage
- proxy nginx
- dockerize application
- real express structure
-
Build and rebuild a image.
docker-compose up --build
docker-compose -f "docker-compose.dev.yml" up --build
-
Run and start containers.
docker-compose up
docker-compose -f "docker-compose.dev.yml" up
-
Stop and clear containers.
docker-compose down
docker-compose -f "docker-compose.dev.yml" down
-
Stop and clear containers, volumes.
docker-compose down -v
docker-compose -f "docker-compose.dev.yml" down -v
-
Build and rebuild a image.
docker-swarm init
docker stack ls
docker service ls
docker stack deploy -c docker-compose.prod.yaml name
docker image build --tag nurettinsenbackend/server --build-arg NODE_ENV=production .
docker push nurettinsenbackend/client
npm init -y
npm install
npm run dev => backend and socket folder
npm start => client folder
upstream client {
server frontend:3000;
}
upstream api {
server backend:5000;
}
server {
listen 80;
listen [::]:80;
server_name _;
location / {
proxy_pass http://client;
}
location /sockjs-node {
proxy_pass http://client;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /api/ {
proxy_pass http://api;
}
location /socket.io {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://socket:6500;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
👤 Nurettin Şen
- Linkedin: @nurettin-sen
- Github: @nuri35