Skip to content

Commit

Permalink
fix docker compose external volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchin committed Dec 23, 2024
1 parent 3ccaf32 commit 75e5394
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 80 deletions.
61 changes: 0 additions & 61 deletions docker/docker-compose-dev.yml

This file was deleted.

47 changes: 37 additions & 10 deletions docker/docker-compose-external-volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,50 @@ volumes:

services:
gplates-postgis:
extends:
file: docker-compose.yml
service: gplates-postgis
image: gplates/postgis
hostname: gplates-postgis
volumes:
- gplates-db-data:/var/lib/postgresql/15/main
networks:
- gplates-net
restart: on-failure
healthcheck:
test: pg_isready -U gplates -d gplates
interval: 1m30s
timeout: 10s
retries: 3

gws:
extends:
file: docker-compose.yml
service: gws
image: gplates/gws
hostname: gws
container_name: docker-gws
volumes:
- gws-code:/gws

networks:
- gplates-net
depends_on:
- gplates-postgis
- gplates-redis
ports:
- 18000:80
restart: on-failure
healthcheck:
test: curl --fail -s "http://localhost:80/raster/query?lon=128.86&lat=-12.42&raster_name=crustal_thickness" || exit 1
interval: 1m30s
timeout: 10s
retries: 3

gplates-redis:
extends:
file: docker-compose.yml
service: gplates-redis
image: redis
hostname: gplates-redis
networks:
- gplates-net
restart: unless-stopped
healthcheck:
test: redis-cli -h gplates-redis ping
interval: 1m30s
timeout: 10s
retries: 3

networks:
gplates-net:
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-gws-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
BASEDIR=$(dirname "$0")
echo "$BASEDIR"
cd $BASEDIR
docker compose -f ../docker/docker-compose-dev.yml run --rm --service-ports gws /bin/bash -c "cd /gws/django/GWS && python3 manage.py runserver 0.0.0.0:80"
docker compose -f ../docker/docker-compose-external-volumes.yml run --rm --service-ports gws /bin/bash -c "cd /gws/django/GWS && python3 manage.py runserver 0.0.0.0:80"
2 changes: 1 addition & 1 deletion scripts/start-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
BASEDIR=$(dirname "$0")
echo "$BASEDIR"
cd $BASEDIR
docker compose -f ../docker/docker-compose-dev.yml run --rm --service-ports gplates-postgis
docker compose -f ../docker/docker-compose-external-volumes.yml run --rm --service-ports gplates-postgis
2 changes: 1 addition & 1 deletion scripts/start-redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
BASEDIR=$(dirname "$0")
echo "$BASEDIR"
cd $BASEDIR
docker compose -f ../docker/docker-compose-dev.yml run --rm --service-ports gplates-redis
docker compose -f ../docker/docker-compose-external-volumes.yml run --rm --service-ports gplates-redis
3 changes: 3 additions & 0 deletions scripts/start-single-gws-prod.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# use ./scripts/start-single-gws-prod.sh `pwd` to use the source code in the current working directory
# use ./scripts/start-single-gws-prod.sh to use the built-in source code

echo $1

HCMD='curl --fail -s "http://localhost:80/reconstruct/reconstruct_points/?points=95,54,142,-33&time=140" || exit 1'
Expand Down
3 changes: 3 additions & 0 deletions scripts/start-single-gws-test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# use ./scripts/start-single-gws-test.sh `pwd` to use the source code in the current working directory
# use ./scripts/start-single-gws-test.sh to use the built-in source code

echo $1

PORT=18007
Expand Down
2 changes: 1 addition & 1 deletion scripts/stop-gws-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
BASEDIR=$(dirname "$0")
echo "$BASEDIR"
cd $BASEDIR
docker compose -f ../docker/docker-compose-code-and-db-volume.yml down
docker compose -f ../docker/docker-compose-external-volumes.yml down
6 changes: 3 additions & 3 deletions test/test-dev-server.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

export GWS_SERVER_URL=http://localhost:18000
export GWS_SERVER_URL=http://localhost:18001

GWS_TEST_VALIDATE_WITH_PYGPLATES=True
GWS_TEST_DB_QUERY=True
export GWS_TEST_VALIDATE_WITH_PYGPLATES=True
export GWS_TEST_DB_QUERY=False

$(dirname "$0")/test-server.sh
4 changes: 2 additions & 2 deletions test/test-pro-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export GWS_SERVER_URL=https://gws.gplates.org

GWS_TEST_VALIDATE_WITH_PYGPLATES=True
GWS_TEST_DB_QUERY=True
export GWS_TEST_VALIDATE_WITH_PYGPLATES=True
export GWS_TEST_DB_QUERY=True

$(dirname "$0")/test-server.sh

0 comments on commit 75e5394

Please sign in to comment.