-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose-cloud.yaml
More file actions
81 lines (79 loc) · 2.13 KB
/
docker-compose-cloud.yaml
File metadata and controls
81 lines (79 loc) · 2.13 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# compose file format version
# (see https://docs.docker.com/compose/compose-file/)
version: "3.7"
services:
# service name (host name on network)
php:
# build: location of the Dockerfile
build: ./php
# volumes: mappling local to container
volumes:
# use cwd for website (dev & debugging only)
- ./jeffstickyphp/:/var/www/html
# log to localhost (debugging only)
- /var/log:/var/log
# links for networking purposes
# legacy feature https://docs.docker.com/network/links/
# todo replace with should use https://docs.docker.com/network/bridge/
networks:
- backend
- frontend
# port forward 80 from container to 8700 host
ports:
- '8700:80'
# environment variables
environment:
- XYZ="this is an example"
# internal dependecies for order of ops
depends_on:
- db
# db:
# no build needed
# using pre built image
db:
# was using latest, error
# https://stackoverflow.com/questions/50360870/pdoexception-sqlstatehy000-2054-the-server-requested-authentication-method
image: mysql:latest
# needed for bug crashing w v 5.7.22 & 5.7.29, problems w 8 (latest
# ref https://stackoverflow.com/questions/48239668/fails-to-initialize-mysql-database-on-windows-10
command: --innodb_use_native_aio=0
environment:
# MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_DATABASE: assignment2
MYSQL_USER: student
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: educate3
networks:
- backend
volumes:
# *entrypoint-init* all scripts .sql, .sh run on startup
- ./dbsetup:/docker-entrypoint-initdb.d
- persistent:/var/lib/mysql
ports:
- "3306"
# testing, do not need port forwarding
# - "3306:3306"
# phpmyadmin
# manage db for testing only
# no build/Dockerfile needed
# using pre built image
phpmyadmin:
links:
- db:db
image: phpmyadmin/phpmyadmin
environment:
MYSQL_USER: student
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: educate3
networks:
- backend
- frontend
ports:
- "8701:80"
depends_on:
- db
volumes:
persistent:
networks:
frontend:
backend: