Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. version: '3.7'
  2. services:
  3.   db:
  4.     image: mysql:5.7
  5.     restart: always
  6.     environment:
  7.       MYSQL_DATABASE: 'db'
  8.       # So you don't have to use root, but you can if you like
  9.       MYSQL_USER: 'third'
  10.       # You can use whatever password you like
  11.       MYSQL_PASSWORD: 'password'
  12.       # Password for root access
  13.       MYSQL_ROOT_PASSWORD: 'password'
  14.     ports:
  15.       # <Port exposed> : < MySQL Port running inside container>
  16.       - '3306:3306'
  17.     expose:
  18.       # Opens port 3306 on the container
  19.       - '3306'
  20.       # Where our data will be persisted
  21.     volumes:
  22.       - my-db:/var/lib/mysql
  23. # Names our volume
  24. volumes:
  25.   my-db:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement