Skip to content

Commit

Permalink
fix: run app without docker (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich authored May 24, 2024
1 parent b742271 commit 68b9394
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ RUN cd /app \
&& chmod g+w /app/cloud_registry/api/ \
&& pip install yq

CMD ["bash", "-c", "cd /app/cloud_registry; python app.py"]
WORKDIR /app

CMD ["python", "cloud_registry/app.py"]
10 changes: 9 additions & 1 deletion cloud_registry/app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
from pathlib import Path
import logging
from foca import Foca
from foca.security.auth import validate_token # noqa: F401

from cloud_registry.ga4gh.registry.service_info import RegisterServiceInfo

logger = logging.getLogger(__name__)


def main():
config_path = Path(__file__).parent / "config.yaml"
if not config_path.exists():
logger.error(f"Config file not found: {config_path}")
raise FileNotFoundError(f"Config file not found: {config_path}")
# create app object
foca = Foca(
config_file="config.yaml",
config_file=config_path,
custom_config_model="service_models.custom_config.CustomConfig",
)
app = foca.create_app()
Expand Down
6 changes: 3 additions & 3 deletions cloud_registry/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ db:
api:
specs:
- path:
- api/20201108.11d2c12.service-info.yaml
- api/20201108.e0358db.openapi.yaml
- api/additions.openapi.yaml
- cloud_registry/api/20201108.11d2c12.service-info.yaml
- cloud_registry/api/20201108.e0358db.openapi.yaml
- cloud_registry/api/additions.openapi.yaml
add_operation_fields:
x-openapi-router-controller: ga4gh.registry.server
add_security_fields:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
restart: unless-stopped
links:
- mongodb
command: bash -c "cd /app/cloud_registry; python app.py"
ports:
- "8080:8080"

Expand Down

0 comments on commit 68b9394

Please sign in to comment.