Public | Automated Build

Last pushed: 2 days ago
Short Description
MySQL Proxy
Full Description

mysqlproxy-docker

Docker container for MySQL Proxy

Usage

/opt/main.lua script is executed in container

Usage with docker-compose

version: '2'

services:
  db:
    image: "mysql:5.7.14"
    expose:
      - "3306"
    ports:
      - "3307:3306"
    volumes:
      - ./mysql/data:/var/lib/mysql
      - ./mysql/conf/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
      - ./mysql/logs:/var/log/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: dbuser
      MYSQL_USER: dbuser
      MYSQL_PASSWORD: password

  mysqlproxy:
    image: gediminaspuksmys/mysqlproxy:0.8.5
    ports:
      - "3308:3306"
    restart: always
    volumes: 
      - ./mysqlproxy/main.lua:/opt/main.lua
    environment:
      PROXY_DB_PORT: 3306
      REMOTE_DB_HOST: db
      REMOTE_DB_PORT: 3306
    links:
      - db
Docker Pull Command
Owner
gediminaspuksmys
Source Repository

Comments (1)
bscheshir
7 months ago

Can u collapse the image layers

ENV MYSQL_PROXY_VERSION 0.8.5
ENV MYSQL_PROXY_TAR_NAME mysql-proxy-$MYSQL_PROXY_VERSION-linux-debian6.0-x86-64bit

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get -y install wget && \
    wget https://downloads.mysql.com/archives/get/file/$MYSQL_PROXY_TAR_NAME.tar.gz && \
    tar -xzvf $MYSQL_PROXY_TAR_NAME.tar.gz && \
    mv $MYSQL_PROXY_TAR_NAME /opt/mysql-proxy && \
    rm $MYSQL_PROXY_TAR_NAME.tar.gz && \
    DEBIAN_FRONTEND=noninteractive apt-get -y remove wget && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/ && \
    chown -R root:root /opt/mysql-proxy

EXPOSE 3306

ADD run.sh /opt/run.sh
RUN chmod u+x /opt/run.sh
ENTRYPOINT [ "/opt/run.sh" ]