-
-
Notifications
You must be signed in to change notification settings - Fork 229
/
docker-compose.grapher.yml
69 lines (66 loc) · 3.03 KB
/
docker-compose.grapher.yml
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
#
# docker-compose.grapher.yml
#
#
# This docker-compose file creates a local dev environment for working with grapher. It is meant for
# the general public.
#
# In this setup, you run the node server and vite locally on your machine, and only MySQL is spun up
# and initialized as a dependency.
#
# The mysql database server is exposed on the host at the default mysql port of 3306 so you can use DB admin
# utilities on the host working against localhost:3306. If you are already running MySQL, you will need to
# disable it to use this script to avoid a port conflict.
#
# Before the first run you should download the database dumps. The easiest way to do this is to run the
# following command from a bash terminal with the root of the project as the working directory.
#
# ./devTools/docker/download-grapher-metadata-mysql.sh
#
# Run `docker-compose up -d` to run all these services in daemon mode. The first time it will take a few minutes
# to build the containers and initialize and fill the database, afterwards it should be up in seconds.
#
# On your local machine, you should copy .env.example to .env, then start `yarn startTmuxServer` or similar
# and navigate to http://localhost:8080 to work with the grapher admin.
#
services:
# Stock mysql database. Root password is hardcoded for now
db:
image: mysql/mysql-server:latest
restart: always
volumes:
- ./devTools/docker/my.cnf:/etc/my.cnf:ro
- mysql_data_public:/var/lib/mysql
- ./logs:/var/log/mysql
ports:
# Exposing via the port specified for Grapher
# Should always be the same as the WordPress port, because we store both DBs on the same server
- "${GRAPHER_DB_PORT}:3306"
environment:
MYSQL_ROOT_PASSWORD: weeniest-stretch-contaminate-gnarl
MYSQL_ROOT_HOST: "%"
# mysql:8.0 container with slight augmentation (+curl, +unzip, +ssh client, ...) for running the DB init scripts
# These init scripts check if the grapher and wordpress databases and users are missing, if so they create them
# and pull the data to have a working dev environment. As the wordpress donwload needs a working ssh access, it
# mounts the SSH agent and ~/.ssh directory into the container
db-load-data:
build:
context: ./devTools/docker/mysql-init-docker
# image: mysql/mysql-server:latest
command: "/app/grapher-mysql-init.sh"
volumes:
- ./devTools/docker:/app
- ./tmp-downloads:/tmp-downloads
# - ~/.ssh:/user/.ssh # map the .ssh directory into the container so it knows about the owid-live ssh configuration
# - ${SSH_AUTH_SOCK}:/ssh-agent # Forward the SSH agent socket into the container
environment:
DB_ROOT_PASS: weeniest-stretch-contaminate-gnarl
DB_ROOT_HOST: db
DATA_FOLDER: "/tmp-downloads"
# SSH_AUTH_SOCK: "/ssh-agent"
env_file:
- .env
depends_on:
- db
volumes:
mysql_data_public: