Skip to content

Commit

Permalink
Remove services prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
TvanWalen committed May 7, 2024
1 parent 8dfb229 commit dc6f7fa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.PHONY = help pip-tools install requirements update test init
dc = docker compose
run = $(dc) run --rm
manage = $(run) metadata-dev python manage.py
manage = $(run) dev python manage.py

help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
Expand Down Expand Up @@ -42,25 +42,25 @@ push_semver:
VERSION=$${VERSION%%\.*} $(MAKE) push

app: ## Run app
$(dc) run --service-ports metadata-app
$(dc) run --service-ports app

dev: migrate ## Run the development app (and run extra migrations first)
$(run) --service-ports metadata-dev
$(run) --service-ports dev

bash: ## Run the container and start bash
$(run) metadata-app bash
$(run) app bash

test: ## Execute tests
$(run) metadata-test pytest $(ARGS)
$(run) test pytest $(ARGS)

lintfix: ## Execute lint fixes
$(run) metadata-test black /src/$(APP)
$(run) metadata-test autoflake /src --recursive --in-place --remove-unused-variables --remove-all-unused-imports --quiet
$(run) metadata-test isort /src/$(APP)
$(run) test black /src/$(APP)
$(run) test autoflake /src --recursive --in-place --remove-unused-variables --remove-all-unused-imports --quiet
$(run) test isort /src/$(APP)

lint: ## Execute lint checks
$(run) metadata-test autoflake /src --check --recursive --quiet
$(run) metadata-test isort --diff --check /src/$(APP)
$(run) test autoflake /src --check --recursive --quiet
$(run) test isort --diff --check /src/$(APP)

clean: ## Clean docker stuff
$(dc) down -v
Expand All @@ -72,5 +72,5 @@ run_import: ## Populate database with new bag data and do
$(manage) run_import $(ARGS)

trivy: ## Detect image vulnerabilities
$(dc) build metadata-app
$(dc) build app
trivy image --ignore-unfixed docker-registry.data.amsterdam.nl/datapunt/iiif-metadata-server
8 changes: 3 additions & 5 deletions docker-compose.override.yml.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
services:
metadata-database:
dev:
ports:
- "5903:5432"

metadata-dev:
- "8002:8000"
volumes:
- ./src:/src
- ./deploy:/deploy
- ./src/importer/tests/data:/tmp/bouwdossiers

metadata-test:
test:
volumes:
- ./src:/src
- ./src/importer/tests/data:/tmp/bouwdossiers
26 changes: 11 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: "3.5"

name: iiif-metadata-server

networks:
amsterdam-bouwdossiers:
name: amsterdam-bouwdossiers
Expand All @@ -12,8 +10,8 @@ x-app: &base-app
context: .
target: app
depends_on:
- metadata-database
- metadata-azurite
- database
- azurite
volumes:
- ./src:/src
- ./deploy:/deploy
Expand All @@ -22,14 +20,14 @@ x-app: &base-app
- default
environment: &base-app-env
SECRET_KEY: 'dev'
DATABASE_HOST: 'metadata-database'
DATABASE_HOST: 'database'
PYTHONBREAKPOINT: true
UWSGI_STATIC_MAP: '/iiif-metadata/static=/static'
AZURITE_STORAGE_CONNECTION_STRING: 'AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://metadata-azurite:10000/devstoreaccount1/;'
entrypoint: /deploy/wait-for-it.sh metadata-database:5432 --
AZURITE_STORAGE_CONNECTION_STRING: 'AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://azurite:10000/devstoreaccount1/;'
entrypoint: /deploy/wait-for-it.sh database:5432 --

services:
metadata-database:
database:
image: amsterdam/postgres12
ports:
- 5432
Expand All @@ -40,21 +38,21 @@ services:
volumes:
- "~/.ssh/datapunt.key:/root/.ssh/datapunt.key"

metadata-azurite:
azurite:
image: mcr.microsoft.com/azure-storage/azurite
ports:
- "10010:10000" # Blob service

metadata-app:
app:
<<: *base-app
build:
context: .
target: app
image: ${REGISTRY:-localhost:5000}/${REPOSITORY:-opdrachten/iiif-metadata-server}:${VERSION:-latest}
depends_on:
- metadata-database
- database

metadata-dev:
dev:
<<: *base-app
hostname: metadata-server
build:
Expand All @@ -64,11 +62,9 @@ services:
<<: *base-app-env
DEBUG: 'true'
USE_JWKS_TEST_KEY: 'true'
external_links:
- metadata-dev:metadata-server
command: python manage.py runserver 0.0.0.0:8000

metadata-test:
test:
<<: *base-app
build:
context: .
Expand Down

0 comments on commit dc6f7fa

Please sign in to comment.