Thiru-Malai / Multicontainer-Student-Management-Portal-Using-MYSQL-And-Docker

This is an implementation of multi container in docker and to containerize DB ( MYSQL ) in one container and Node JS in another container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multicontainer-Student-Management-Portal-Using-MYSQL-and-Docker

This is an implementation of multi container in docker and to containerize DB ( MYSQL ) in one container and Node JS in another container.

How to run?

docker compose up

Output

Alt text

Multicontainer Diagram

Alt text

Docker Compose File

   
version: "3.8"

services: 
  app:
    build: 
      context: .
      dockerfile: Dockerfile
    ports: 
      - 3000:3000
    volumes: 
      - .:/usr/src/app
      - '/usr/src/app/node_modules'
    depends_on: 
      - mysql_server
  
  mysql_server:
    command: --default-authentication-plugin=mysql_native_password
    image: mysql:5.7
    environment: 
      - MYSQL_DATABASE=TCE
      - MYSQL_USER=thiru
      - MYSQL_PASSWORD=1234
      - MYSQL_ROOT_PASSWORD=1234
  

Dockerfile

  
# Latest Node Version
FROM node:latest
    
WORKDIR /usr/src/app

COPY package*.json .

RUN npm install

VOLUME [ "/usr/src/app/node_modules" ]

COPY . .

EXPOSE 3000

CMD ["node", "index.js"]
  

About

This is an implementation of multi container in docker and to containerize DB ( MYSQL ) in one container and Node JS in another container


Languages

Language:EJS 58.7%Language:JavaScript 32.7%Language:CSS 5.8%Language:Dockerfile 2.8%