Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Makefile): Use in-built compose for docker #865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN ./ooni_download_geoip.py

RUN rm -rf /scripts

# The API codebase is mounted under /app by docker-compose
# The API codebase is mounted under /app using `docker compose` command

# Set our work directory to our app directory
WORKDIR /app/
Expand Down
10 changes: 5 additions & 5 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ TESTARGS ?= \
#tests/integ/test_integration_auth.py

.state/docker-build: Dockerfile
docker-compose build --force-rm api
docker compose build --force-rm api
mkdir -p .state
touch .state/docker-build

serve: .state/docker-build
docker-compose up --remove-orphans
docker compose up --remove-orphans

build:
@$(MAKE) .state/docker-build
Expand All @@ -37,12 +37,12 @@ initdb:
# Setup database fixtures
# Fetch fingerprints from github
# run fastpath to populate the DB
docker-compose run --rm api python3 -m pytest --setup-only --create-db -s -x tests/unit/test_unit.py
docker compose run --rm api python3 -m pytest --setup-only --create-db -s -x tests/unit/test_unit.py

tests: .state/docker-build
docker-compose run --rm api python3 -m pytest $(T) $(TESTARGS)
docker compose run --rm api python3 -m pytest $(T) $(TESTARGS)

run-local:
docker-compose run --service-ports --rm api
docker compose run --service-ports --rm api

.PHONY: build initdb tests serve run-local
3 changes: 1 addition & 2 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ File bugs with the API inside of: https://github.com/ooni/backend/issues/new

## Local development

You can run the OONI API locally in a development environment using `docker`
and `docker-compose`. Follow the instructions below to set it up.
You can run the OONI API locally in a development environment using `docker`. Follow the instructions below to set it up.

### Quickstart

Expand Down
2 changes: 1 addition & 1 deletion api/tools/check_apispec_changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
docker-compose run --rm api python3 ooniapi/app.py
docker compose run --rm api python3 ooniapi/app.py
if diff apispec.json docs/apispec.json; then
echo docs/apispec.json is up to date
else
Expand Down