Skip to content

Instantly share code, notes, and snippets.

@jrgavilanes
Created November 30, 2021 17:51
Show Gist options
  • Save jrgavilanes/5c2aafd403fd1fb1d59a5bb19fcdb7b4 to your computer and use it in GitHub Desktop.
Save jrgavilanes/5c2aafd403fd1fb1d59a5bb19fcdb7b4 to your computer and use it in GitHub Desktop.
docker con mysql y phpmyadmin
version: '3'
services:
# Database
db:
image: mysql:5.7
ports:
- '3306:3306'
volumes:
- db_data:/var/lib/mysql
# restart: always
environment:
MYSQL_ROOT_PASSWORD: juanra
MYSQL_DATABASE: mibd
MYSQL_USER: juanra
MYSQL_PASSWORD: juanra
networks:
- mi-red
# phpmyadmin
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
# restart: always
ports:
- '3000:80'
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: juanra
networks:
- mi-red
# # Servidor de aplicación
# ubuntu:
# depends_on:
# - db
# image: ubuntu:20.04
# ports:
# - '5000:5000'
# # restart: always
# # command: apt update -y && apt install nodejs npm -y && sleep 72000
# command: sleep 72000
# volumes: ['./code:/app']
# environment:
# DB_HOST: db
# DB_USER: usuario
# DB_PASSWORD: clave
# DB_DATABASE: mibd
# networks:
# - mi-red
networks:
mi-red:
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment