daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Oct 17th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: '3'
  2. services:
  3.   app:
  4.     build: ./../../
  5.     working_dir: /go/src/github.com/username/appname
  6.     #restart: always
  7.     env_file:
  8.       - env
  9.     depends_on:
  10.       - db
  11.     command: sh /go/src/github.com/username/appname/wait.sh db /go/bin/appname
  12.     logging:
  13.       driver: syslog
  14.  
  15.   db:
  16.     image: mysql:5.7
  17.     volumes:
  18.       - db_data:/var/lib/mysql
  19.     restart: always
  20.     environment:
  21.       MYSQL_RANDOM_ROOT_PASSWORD: 1
  22.       #MYSQL_ROOT_PASSWORD: password
  23.       MYSQL_DATABASE: dbname
  24.       MYSQL_USER: username
  25.       MYSQL_PASSWORD: password
  26.     logging:
  27.       driver: syslog
  28.  
  29. volumes:
  30.   db_data:
  31.    
  32. FROM golang:alpine
  33.  
  34. ADD . /go/src/github.com/username/appname
  35. WORKDIR /go/src/github.com/username/appname
  36. RUN apk add --update git
  37. RUN apk add --update mysql-client
  38.  
  39. RUN go get -u github.com/Masterminds/glide
  40. RUN glide install
  41. RUN go install
  42.  
  43. EXPOSE 80
  44.    
  45. #!/bin/sh
  46.  
  47. set -e
  48.  
  49. host="$1"
  50. shift
  51. cmd="$@"
  52.  
  53. until mysqladmin ping -h host --silent; do
  54.   echo 'waiting for mysql'
  55.   sleep 1
  56. done
  57.  
  58. echo "MySQL is up - executing command"
  59. exec $cmd
  60.    
  61. 127.0.0.1   localhost
  62. ::1 localhost ip6-localhost ip6-loopback
  63. fe00::0 ip6-localnet
  64. ff00::0 ip6-mcastprefix
  65. ff02::1 ip6-allnodes
  66. ff02::2 ip6-allrouters
  67. 172.17.0.2  fadc826189c0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top