Skip to content

Instantly share code, notes, and snippets.

@RdeWilde
Created October 9, 2017 20:04
Show Gist options
  • Save RdeWilde/970438b17597b94bf56ce8861314e8a4 to your computer and use it in GitHub Desktop.
Save RdeWilde/970438b17597b94bf56ce8861314e8a4 to your computer and use it in GitHub Desktop.
Docker cluster for ION web application
version: '3'
services:
web:
image: nginx:latest
ports:
- "80:80"
- "3000:443"
restart: always
volumes:
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./etc/ssl:/etc/ssl"
- "./web:/var/www/html"
depends_on:
- php
- mysqldb
php:
image: nanoninja/php-fpm
restart: always
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./web:/var/www/html"
composer:
image: "composer"
volumes:
- "./web:/app"
command: install
# myadmin:
# image: phpmyadmin/phpmyadmin
# container_name: phpmyadmin
# ports:
# - "8080:80"
# environment:
# - PMA_ARBITRARY=1
# - PMA_HOST=${MYSQL_HOST}
# restart: always
# depends_on:
# - mysqldb
mysqldb:
image: mysql
container_name: ${MYSQL_HOST}
restart: always
env_file:
- ".env"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
ports:
- "8989:3306"
volumes:
- "./data/db/mysql:/var/lib/mysql"
iond:
image: rdewilde/iond
container_name: iond
ports:
- "12700:12700"
- "12705:12705"
restart: always
env_file:
- ".env"
environment:
- IOND_USER=${IOND_USER}
- IOND_PASS=${IOND_PASS}
- IOND_ALLOWIP=${IOND_ALLOWIP}
- IOND_ARGS=${IOND_ARGS}
volumes:
- "./ioncoin/:/root/.ioncoin/"
memcached:
image: memcached
container_name: memcached
command: memcached -m 128m
@RdeWilde
Copy link
Author

RdeWilde commented Oct 9, 2017

Example .env file:

#!/usr/bin/env bash

# See https://docs.docker.com/compose/environment-variables/#the-env-file
IOND_USER=ionapi
IOND_PASS=DjsaDIasjfisdjf9djf@(#Fj9
IOND_ALLOWIP=127.0.0.1
IOND_ARGS=-testnet

MYSQL_HOST=mysql
MYSQL_DATABASE=test
MYSQL_ROOT_USER=admin
MYSQL_ROOT_PASSWORD=admin
MYSQL_USER=test
MYSQL_PASSWORD=test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment