OpsMon


Dockerifle

플래그 파일명은 아래와 같은 형식으로 /flag 폴더에 저장

  • flag_05a147418bca20ef2b846f0771840034e6272c4ce9e52064d201e0a673b3b2ef
FROM python:3.12-slim
 
WORKDIR /app
 
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
 
COPY . .
 
RUN mkdir -p /flag && \
    mv flag /flag/flag_$(python -c "import secrets; print(secrets.token_hex(32))") && \
    chmod 444 /flag/flag_*
 
CMD ["python", "app.py"]

docker-compose.yml

컨테이너에서 운영중인 서비스는 3개

  • redis, web, worker
services:
  redis:
    image: redis:7-alpine
    container_name: opsmon-redis
    restart: always
    networks: [opsmon_net]
 
  web:
    build: . 
    container_name: opsmon-web
    command: python app.py
    ports:
      - "5000:5000"
    depends_on: [redis]
    restart: always
    networks: [opsmon_net]
 
  worker:
    build: .       
    container_name: opsmon-worker
    command: python worker.py
    depends_on: [redis]
    restart: always
    networks: [opsmon_net]
 
networks:
  opsmon_net:
    driver: bridge

🐛.. 🐛.. 🐛..


REFERENCE