Need some help regarding docker-compose params

Viewed 17

I have a project with docker-compose.yml file:

version: "3.9"
services:
  nginx:
    build: 
      context: ./
      dockerfile: nginx/Dockerfile
    container_name: nginx_lb
    volumes:
      - vxx_data:/var/www/html:ro
      - ./certbot/conf:/etc/letsencrypt
      - ./certbot/www:/var/www/certbot
    ports:
      - "80:80"
      - "443:443"
    command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
    depends_on:
      - web
    restart: unless-stopped
  nodejs:
    build:
      context: ./
      dockerfile: nodejs/Dockerfile
    container_name: nodejs
    volumes:
      - vxx_data:/app
    depends_on:
      - web
    restart: unless-stopped

  certbot:
    image: certbot/certbot
    restart: unless-stopped
    container_name: ssl_cert
    volumes:
      - ./certbot/conf:/etc/letsencrypt
      - ./certbot/www:/var/www/certbot
    entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
    depends_on:
      - nginx

volumes:
  vxx_data:
  db-data: 

I need to understand this line with :ro

  volumes:
  - vxx_data:/var/www/html:ro

Normally we access the volume data without :ro and It works but here I do not understand this switch and when I down the docker-compose it reset all work and files. This is the main issue.

0 Answers
Related