forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
executable file
·96 lines (83 loc) · 2.97 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
VAGRANTFILE_API_VERSION = "2"
# set docker as the default provider
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
# disable parallellism so that the containers come up in order
ENV['VAGRANT_NO_PARALLEL'] = "1"
ENV['FORWARD_DOCKER_PORTS'] = "1"
DOCKER_HOST_NAME = "dockerhost"
DOCKER_HOST_VAGRANTFILE = "vagrant/docker-host/Vagrantfile"
CKAN_HOME = "/usr/lib/ckan/default"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# define a Postgres Vagrant VM with a docker provider
config.vm.define "postgres" do |app|
app.vm.provider "docker" do |d|
# use a vagrant host if required (OSX & Windows)
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
# Build the container & run it
d.build_dir = "docker/postgres"
d.build_args = ["--tag=postgres"]
d.name = "postgres"
d.ports = ["5432:5432"]
d.env = {
CKAN_PASS: "ckan_pass",
DATASTORE_PASS: "datastore_pass",
}
d.has_ssh = false
end
end
# define a Solr Vagrant VM with a docker provider
config.vm.define "solr" do |app|
app.vm.provider "docker" do |d|
# use a vagrant host if required (OSX & Windows)
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
# Build the container & run it
d.build_dir = "docker/solr"
d.build_args = ["--tag=solr"]
d.name = "solr"
d.ports = ["8983:8983"]
d.has_ssh = false
end
end
# define a datapusher Vagrant VM with a docker provider
config.vm.define "datapusher" do |app|
app.vm.provider "docker" do |d|
# use a vagrant host if required (OSX & Windows)
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
# Build the container & run it
d.build_dir = "_service-provider/_datapusher"
d.build_args = ["--tag=datapusher"]
d.name = "datapusher"
d.ports = ["8800:8800"]
d.has_ssh = false
end
end
# define a CKAN Vagrant VM with a docker provider
config.vm.define "ckan" do |app|
app.vm.provider "docker" do |d|
# use a vagrant host if required (OSX & Windows)
d.vagrant_vagrantfile = "#{DOCKER_HOST_VAGRANTFILE}"
d.vagrant_machine = "#{DOCKER_HOST_NAME}"
# Build the container & run it
d.build_dir = "."
d.build_args = ["--tag=ckan"]
d.name = "ckan"
d.ports = ["2222:22"]
d.ports = ["5000:5000"]
d.ports = ["8080:80"]
d.link("postgres:postgres")
d.link("solr:solr")
d.link("datapusher:datapusher")
d.cmd = ["/sbin/my_init", "--enable-insecure-key"]
end
app.vm.synced_folder "_src", "#{CKAN_HOME}/src",
owner: "root",
group: "root",
mount_options: ["dmode=775,fmode=664"],
create: true
app.ssh.username = "root"
app.ssh.private_key_path = "docker/insecure_key"
end
end