-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker development environment * newlines * do not make build dep of up. this way build can be separate way to hard rebuild images * just mount hoot-ui-2x dir * removing extra lines * adding missing and fixing incorrect volumes * let us attach a remote debugger for services * only copy files/war when we build them * add db_host_osmapi to DatabaseConfigLocal target * correct osmapi host name * handle older versions of docker/docker-compose * git ignore .npm * update hoot-ui-2x submodule * add missing new line * Updates to docker PR to work in fresh git repo clone (#5614) * legacy hoot submodule hoot-ui/ has been removed * don't need hootenanny-id in core-services container add parent submodule git volume to frontend to allow npm deps from github to work * use node 14 to match core-services, install git for use in npm * don't need deploy frontend to tomcat add a make clean target just deploy exploded webapp, not war file * use unprotected auth endpoint as health check * don't need hootenanny-id dir in tomcat * add clean property, remove UI mention from build services property * Submodule hoot-ui-2x 9df7cba39..ba88f7ad9: > dist/build updates > use https to fetch github dependency, refresh lock versions * restore FORCE to always attempt VersionDefines.h rebuild * this seems to be causing ./HOOT_VERSION_GEN to loop * don't need this * revert changes to see if it affects 'make archive' * try .PHONE instead of FORCE * Submodule hoot-ui-2x 521e79585..d2bbe9541: > Merge remote-tracking branch 'origin/hoot2x' into docker_updates * wip: add some docker command refs * need to run configure each time because generated Makefile can get stale * need to call this too when core builds services * Move versions out to .env file and expose in docker-compose.yml (#5675) * consolidate lib version configs in VagrantProvisionVars.sh for now * add other ARG values * move versions to .env template file * missed adding this template file * downgrade glpk * use PG 14 * don't need bash * these are written in by Makefile.docker * PG 13 is now working for me * Submodule hoot-ui-2x 7e0099d18...804b1502f: > update build info > Docker updates (#2050) > update build info > Bump semver from 5.7.1 to 5.7.2 (#2063) > Bump word-wrap from 1.2.3 to 1.2.4 (#2064) > Treat folders with null parent id as being under root (id=0) (#2065) > update build info > Add option to clip grail pull data to extent (#2062) < replace with hoot2x (reverting lock update) < Merge remote-tracking branch 'origin/hoot2x' into docker_updates < Merge remote-tracking branch 'origin/hoot2x' into docker_updates < dist/build updates < use https to fetch github dependency, refresh lock versions --------- Co-authored-by: Brian Hatchl <[email protected]>
- Loading branch information
1 parent
056464a
commit 06e30f5
Showing
24 changed files
with
744 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
POSTGRESQL_VERSION=13 | ||
GLPK_VERSION=4.64 | ||
LIBOAUTHCPP_VERSION=0.1.0 | ||
LIBPHONENUMBER_VERSION=8.12.39 | ||
LIBPOSTAL_VERSION=1.1 | ||
NODE_VERSION=14.16.1 | ||
NPM_VERSION=6.14.12 | ||
V8_VERSION=8.4.371.19 | ||
STXXL_VERSION=1.3.1 | ||
ARMADILLO_VERSION=10.8.2 | ||
GDAL_VERSION=3.2.3 | ||
GEOS_VERSION=3.9.3 | ||
LIBGEOTIFF_VERSION=1.6.0 | ||
PROJ_VERSION=7.2.1 | ||
DEVTOOLSET_VERSION=8 | ||
JDK_VERSION=1.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,4 +185,11 @@ config.rpath | |
0 | ||
tbs/0 | ||
.DS_Store | ||
.ccache | ||
.ccache/**/* | ||
.m2 | ||
.env | ||
hoot.env | ||
.bash_history | ||
.config | ||
.npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## Docker development environment cheat sheet | ||
|
||
|
||
To start the containers | ||
>make -f Makefile.docker up | ||
|
||
To stop the containers | ||
>make -f Makefile.docker down | ||
|
||
To tail tomcat logs | ||
>docker-compose logs --follow core-services | ||
|
||
To bash to the core-services container | ||
>docker-compose exec core-services bash | ||
|
||
To force clean/build on container start, modify hoot.env _e.g._ | ||
``` | ||
HOOT_CLEAN=0 | ||
HOOT_BUILD_CORE=1 | ||
HOOT_BUILD_HOOT_SERVICES=1 | ||
HOOT_BUILD_JS_SCHEMA=0 | ||
HOOT_BUILD_TRANSLATION_SERVER=0 | ||
HOOT_BUILD_NODE_EXPORT_SERVER=0 | ||
HOOT_SERVICES_HOST=core-services | ||
HOOT_SERVICES_PORT=8080 | ||
HOOT_NPM_INSTALL=0 | ||
``` | ||
to set any properties from 0 to 1 and then stop/start the containers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
UID=$(shell id -u) | ||
GID=$(shell id -g) | ||
|
||
DOCKER_VERSION := $(shell docker --version 2>/dev/null) | ||
|
||
ifndef DOCKER_VERSION | ||
$(error "command docker is not available, please install Docker") | ||
endif | ||
|
||
# The "new" version integrates compose in the docker command. | ||
# It also fixes a bug with stopping log output when the "--follow" option is set | ||
COMPOSE_COMMAND=docker compose | ||
|
||
DOCKER_COMPOSE_NEW := $(shell docker compose version 2>/dev/null) | ||
ifndef DOCKER_COMPOSE_NEW | ||
DOCKER_COMPOSE_OLD := $(shell docker-compose --version 2>/dev/null) | ||
ifdef DOCKER_COMPOSE_OLD | ||
COMPOSE_COMMAND = docker-compose | ||
else | ||
$(error "docker compose is not available, please install it") | ||
endif | ||
endif | ||
|
||
hoot.env: | ||
cp hoot.env.example hoot.env | ||
|
||
.env: hoot-ui-2x/README.md | ||
cp .env_versions .env | ||
mkdir -p bin lib .ccache | ||
echo "HOOT_UID=$(UID)" >> .env | ||
echo "HOOT_GID=$(GID)" >> .env | ||
echo "HOOT_USER=hoot" >> .env | ||
echo "HOOT_GROUP=hoot" >> .env | ||
echo "HOOT_HOME=/var/lib/hootenanny" >> .env | ||
|
||
conf/database/DatabaseConfigLocal.sh: | ||
touch conf/database/DatabaseConfigLocal.sh | ||
chmod +x conf/database/DatabaseConfigLocal.sh | ||
echo "#!/bin/bash;" >> conf/database/DatabaseConfigLocal.sh | ||
echo "set -euo pipefail;" >> conf/database/DatabaseConfigLocal.sh | ||
echo "export DB_HOST=postgres" >> conf/database/DatabaseConfigLocal.sh | ||
echo "export DB_HOST_OSMAPI=postgres" >> conf/database/DatabaseConfigLocal.sh | ||
|
||
hoot-ui-2x/README.md: | ||
git submodule update --init | ||
|
||
build: .env hoot.env conf/database/DatabaseConfigLocal.sh hoot-ui-2x/README.md | ||
DOCKER_BUILDKIT=1 $(COMPOSE_COMMAND) build --no-cache | ||
|
||
up: .env hoot.env conf/database/DatabaseConfigLocal.sh hoot-ui-2x/README.md | ||
DOCKER_BUILDKIT=1 $(COMPOSE_COMMAND) up -d | ||
|
||
down: .env hoot.env | ||
DOCKER_BUILDKIT=1 $(COMPOSE_COMMAND) down | ||
|
||
distclean: .env hoot.env | ||
DOCKER_BUILDKIT=1 $(COMPOSE_COMMAND) down --volumes --rmi all | ||
rm -fr .ccache lib bin \ | ||
.env hoot.env hoot-ui-2x/node_modules \ | ||
conf/database/DatabaseConfigLocal.sh | ||
|
||
PHONY: \ | ||
build \ | ||
distclean \ | ||
down \ | ||
up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
version: "3.7" | ||
x-args: &default-args | ||
hoot_uid: "${HOOT_UID}" | ||
hoot_gid: "${HOOT_GID}" | ||
hoot_user: "${HOOT_USER}" | ||
hoot_group: "${HOOT_GROUP}" | ||
hoot_home: "${HOOT_HOME}" | ||
postgresql_version: "${POSTGRESQL_VERSION}" | ||
glpk_version: "${GLPK_VERSION}" | ||
liboauthcpp_version: "${LIBOAUTHCPP_VERSION}" | ||
libphonenumber_version: "${LIBPHONENUMBER_VERSION}" | ||
libpostal_version: "${LIBPOSTAL_VERSION}" | ||
node_version: "${NODE_VERSION}" | ||
npm_version: "${NPM_VERSION}" | ||
v8_version: "${V8_VERSION}" | ||
stxxl_version: "${STXXL_VERSION}" | ||
armadillo_version: "${ARMADILLO_VERSION}" | ||
gdal_version: "${GDAL_VERSION}" | ||
geos_version: "${GEOS_VERSION}" | ||
libgeotiff_version: "${LIBGEOTIFF_VERSION}" | ||
proj_version: "${PROJ_VERSION}" | ||
devtoolset_version: "${DEVTOOLSET_VERSION}" | ||
stxxl_version: "${STXXL_VERSION}" | ||
jdk_version: "${JDK_VERSION}" | ||
services: | ||
frontend: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.frontend | ||
args: *default-args | ||
hostname: frontend | ||
ports: | ||
- 8080:8080 | ||
env_file: | ||
- hoot.env | ||
volumes: | ||
- ./hoot-ui-2x:${HOOT_HOME}/hoot-ui-2x:rw | ||
- ./.git/modules/hoot-ui-2x:${HOOT_HOME}/.git/modules/hoot-ui-2x:rw | ||
postgres: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.postgres | ||
args: *default-args | ||
hostname: postgres | ||
env_file: | ||
- hoot.env | ||
volumes: | ||
- postgres-data:/var/lib/pgsql/${POSTGRESQL_VERSION}/data:rw | ||
core-services: | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
frontend: | ||
condition: service_healthy | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.core-services | ||
args: *default-args | ||
hostname: core-services | ||
env_file: | ||
- hoot.env | ||
ports: | ||
- 8888:8080 | ||
- 8094:8094 | ||
- 8096:8096 | ||
- 8101:8101 | ||
- 8000:8585 | ||
volumes: | ||
- ./:${HOOT_HOME}:rw | ||
- tomcat8-hoot-services:/var/lib/tomcat8/webapps/hoot-services:rw | ||
|
||
volumes: | ||
postgres-data: | ||
tomcat8-hoot-services: |
Oops, something went wrong.