version: '3.3' services: db: image: mysql:latest container_name: mysql restart: always environment: # So you don't have to use root, but you can if you like MYSQL_USER: 'stelian' # You can use whatever password you like MYSQL_PASSWORD: '123' # Password for root access MYSQL_ROOT_PASSWORD: '123' ports: # : < MySQL Port running inside container> - '3307:3306' expose: # Opens port 3307 on the container - '3307' # Where our data will be persisted command: --performance-schema --secure-file-priv="" volumes: - my-db:/var/lib/mysql # Names our volume volumes: my-db: