https://github.com/datadavev/ezid_docker
Source for building EZID service docker image.
https://github.com/datadavev/ezid_docker
Last synced: about 1 year ago
JSON representation
Source for building EZID service docker image.
- Host: GitHub
- URL: https://github.com/datadavev/ezid_docker
- Owner: datadavev
- License: mit
- Created: 2020-08-24T21:06:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T15:01:59.000Z (almost 6 years ago)
- Last Synced: 2025-02-02T09:27:24.998Z (over 1 year ago)
- Language: Shell
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
EZID Docker
===========
Source for building EZID service docker image.
The application itself is a Django app and has many dependencies.
`pyenv` is used to provide a level of python library version
independence, and as such it is necessary to install the build tools in
the image to provide the expected python and library versions.
Notes
-----
Building the image (set appropriate values for `ADMIN_PASSWORD` and
`DB_PASSWORD`):
docker build \
--tag base_aws:1.0 \
--build-arg GIT_BRANCH=docker-setup \
--build-arg ADMIN_PASSWORD=admin \
--build-arg DB_PASSWORD=db_password \
.
Create and run container (web server will listen on 18080 when started):
docker run --publish 18080:18080 -it --name aw_ezid_1 base_aws:1.0
To start the apache server in the Docker container:
# su - ezid
[ezid]$ ~/etc/init.d/httpd start
Restart container:
docker start -ia aw_ezid_1
Remove container:
docker container rm aw_ezid_1
List images:
docker images
Remove an image:
docker image rm HASH
MariaDB
-------
Get instance of MariaDB running and clone content from stage or dev
database. \[1\].
docker pull mariadb/server:10.4
docker run -d --name ezid_maria -e MARIADB_ROOT_PASSWORD=my_root_passwd mariadb/server:10.4
`docker run --name ezid-mariadb \ -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb:10`
To access the database service from the container, use the special DNS
name for the host. \[2\] .OS X e.g.:
mysql -h docker.for.mac.host.internal -u root -p
### Copying the database
Create a dump of the database using `mysqldump` \[3\]. Hint: This can be
done on your localhost by opening a tunnel to the dev or stage instance
of EZID.
mysqldump -h ${DB_HOST} \
-u ezidrw \
-p \
--single-transaction \
--databases ezid > ezid_dump.sql
References
----------
\[1\] “Installing and Using MariaDB via Docker,” *MariaDB
KnowledgeBase*.
(accessed Aug. 26, 2020).
\[2\] “How to access host port from docker container,” *Stack Overflow*.
(accessed Aug. 26, 2020).
\[3\] “MySQL :: MySQL 8.0 Reference Manual :: 4.5.4 mysqldump — A
Database Backup Program.”
(accessed Aug.
26, 2020).