tenongene / visitor-count-app

0 stars 0 forks source link

Dockerize Application, and spin up together with a Redis instance into a docker-compose #5

Open tenongene opened 1 year ago

tenongene commented 1 year ago

version: "3.9"
services: 
  web:
    build: .
    ports:
      - 7575:7575
    depends_on:
      - db

  db:
    image: "redis:7-alpine"
    ports: 
      - 6379:6379
    restart: always
    volumes:
      - ./data:/data
    command: ["redis-server", "--save 60 1", "--loglevel warning"]

=======================================


Image

tenongene commented 1 year ago

FROM node:alpine3.16
WORKDIR /visitor_count_app
COPY . .
RUN npm install
EXPOSE 7575
CMD ["npx", "nodemon"]

===========================================

Image

==========================

Executing docker-compose with build

tenongene commented 1 year ago

Image

===============================

Application running in docker.