-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker
60 lines (54 loc) · 1.22 KB
/
docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
i created a network with - "docker network create base"
My wordpress docker-compose.yml
version: "3"
services:
#Wordpress (image based on Apache)
wordpress:
image: wordpress:latest
restart: always
ports:
- "45678:80"
environment:
WORDPRESS_DB_HOST: db_db_1:3306
WORDPRESS_DB_USER: 'admin'
WORDPRESS_DB_PASSWORD: '1628'
WORDPRESS_DB_NAME: 'wordpress'
volumes:
["./:/var/www/html"]
networks:
- default
networks:
default:
external:
name: base
My Database Docker-compose.yml
version: '3'
services:
db:
image: mysql:latest
restart: always
environment:
# So you don't have to use root, but you can if you like
MYSQL_USER: 'admin'
# You can use whatever password you like
MYSQL_PASSWORD: '1628'
# Password for root access
MYSQL_ROOT_PASSWORD: '1628'
ports:
# <Port exposed> : < MySQL Port running inside container>
- '3306:3306'
expose:
# Opens port 3306 on the container
- '3306'
# Where our data will be persisted
volumes:
- my-db:/var/lib/mysql
networks:
- default
# Names our volume
volumes:
my-db:
networks:
default:
external:
name: base