Giter Club home page Giter Club logo

mlflow-docker-compose's Introduction

Mlflow-docker-compose

  1. Build dockerfile
  2. Set .env file for docker-compose
  3. Run "docker-compose up -d"

mlflow dockerfile

FROM continuumio/miniconda3:latest
WORKDIR /app

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y git
RUN pip install mlflow psycopg2-binary pymysql boto3

RUN cd /app && git clone https://github.com/mlflow/mlflow-example.git

COPY wait-for-it.sh wait-for-it.sh

RUN chmod +x wait-for-it.sh

docker-compose

version: "3.3"
services:
  db:
    container_name: mlflow-db
    image: postgres:latest
    restart: always
    expose:
      - ${DB_PORT}
    environment:
      - POSTGRES_DB=${DB_NAME}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PW}
      - TZ=Asia/Seoul
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
      interval: 15s
      timeout: 10s
      retries: 5
    volumes:
      - postgres-db-volume:/var/lib/postgresql/data
    
  mlflow-server:
    container_name: mlflow-server
    image: mlflow:test
    restart: unless-stopped
    depends_on:
      - "db"
    ports:
      - ${MLFLOW_PORT}:${MLFLOW_PORT}
    environment:
      - BACKEND=postgresql://${DB_USER}:${DB_PW}@db:${DB_PORT}/${DB_NAME}
    entrypoint:
      - "/bin/sh"
      - "-c"
      - "mlflow server --host 0.0.0.0 --port ${MLFLOW_PORT} --backend-store-uri $${BACKEND} --default-artifact-root file:${ML_MODEL_DIR}"
    healthcheck:
      test : ["CMD", "wget", "-O/dev/null", "-q", "http://localhost:${MLFLOW_PORT}/"]
      interval: 15s
      timeout: 15s
      retries: 3
    volumes:
      - mlflow-volume:/

volumes:
  postgres-db-volume:
    driver: local
    driver_opts:
      type: "none"
      o: "bind"
      device: "/data/postgresql"
  mlflow-volume:
    driver: local
    driver_opts:
      type: "none"
      o: "bind"
      device: "data/mlflow"

mlflow-docker-compose's People

Contributors

sgtyang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.