-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
119 lines (95 loc) · 4.44 KB
/
Vagrantfile
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
DOCKER_HOST_NAME = "Practera Docker Host"
DOCKER_HOST_VAGRANTFILE = "./DockerHostVagrantfile"
mytoken = `aws ecr get-authorization-token --output text --query authorizationData[].authorizationToken | base64 -D | cut -d: -f2`
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
######data######
config.vm.define "data" do |v| ### VM's Name
v.vm.provider "docker" do |d|
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.name = "practera-data" ### Container's Name
d.remains_running = false ### Turn this to true only if there exist commands maintaining in running state.
d.build_dir = "docker/develop/data" ### The path of data
# d.build_args = ["-t=data"] ### Tag
end
v.vm.synced_folder ".", "/app" ### sync folders from the host Vagrant is running
# v.vm.synced_folder "../pgdata", "/pgdata"
end
######postgres######
config.vm.define "postgres" do |v| ### VM's Name
v.vm.provider "docker" do |d|
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.name = "practera-postgres" ### Container's Name
d.remains_running = true ### Turn this to true only if there exist commands maintaining in running state.
d.image = "postgres:9.4"
# d.build_args = ["-t=postgres"]
d.ports = ["5432:5432"]
d.create_args = ["--volumes-from=practera-data"]
d.env = {
LC_ALL: "C.UTF-8",
PGDATA: "/pgdata",
}
end
v.vm.synced_folder "./docker/develop/postgres/entrypoint", "/docker-entrypoint-initdb.d"
end
######redis#####
config.vm.define "redis" do |v| ### VM's Name
v.vm.provider "docker" do |d|
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.name = "practera-redis" ### Container's Name
d.remains_running = true ### Turn this to true only if there exist commands maintaining in running state.
d.image = "redis"
# d.build_args = ["-t=redis"]
end
end
######web######
config.vm.define "web" do |v| ### VM's Name
v.vm.provider "docker" do |d|
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.name = "practera-web" ### Container's Name
d.remains_running = true ### Turn this to true only if there exist commands maintaining in running state.
d.image = "350544449840.dkr.ecr.ap-southeast-2.amazonaws.com/practera/develop:latest"
# d.build_args = ["-t=web"]
d.ports = ["80:80"]
d.link("practera-postgres:practera-postgres")
d.link("practera-redis:practera-redis")
### Make sure sshd run in the container started, otherwise it will stick in booting state.
# d.has_ssh = true
d.create_args = ["--dns=8.8.8.8", "--dns=8.8.4.4", "--volumes-from=practera-data"]
d.email = "[email protected]"
d.username = "AWS"
d.password = mytoken
d.auth_server = "350544449840.dkr.ecr.ap-southeast-2.amazonaws.com"
end
# v.ssh.port = 22
### SSH-configuration, refering to ./vagrant-practera
# v.ssh.username = "root"
# v.ssh.password = "PASSWORD"
# v.ssh.private_key_path = "insecure_key"
end
#####analytics#####
config.vm.define "analytics" do |v| ### VM's Name
v.vm.provider "docker" do |d|
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.name = "practera-analytics" ### Container's Name
d.remains_running = true
d.image = "350544449840.dkr.ecr.ap-southeast-2.amazonaws.com/practera/analytics:latest"
# d.build_args = ["-t=analytics"]
d.ports = ["8787:8787"]
d.link("practera-postgres:practera-postgres")
# d.has_ssh = true
d.create_args = ["--volumes-from=practera-data"]
d.email = "[email protected]"
d.username = "AWS"
d.password = mytoken
d.auth_server = "350544449840.dkr.ecr.ap-southeast-2.amazonaws.com"
end
end
end