-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create project iatlas-api based on iatlas-data
- Loading branch information
1 parent
6aff968
commit 90d3a13
Showing
11 changed files
with
172 additions
and
0 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,6 @@ | ||
**/*.md | ||
.gitignore | ||
.git/ | ||
Dockerfile | ||
no_commit/ | ||
scripts/ |
Empty file.
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,26 @@ | ||
# git | ||
# used by git-log to rewrite usernames | ||
.mailmap | ||
git-genui.config.json | ||
|
||
# produced vignettes | ||
vignettes/*.html | ||
vignettes/*.pdf | ||
|
||
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 | ||
.httr-oauth | ||
|
||
# Generated files | ||
.DS_Store | ||
|
||
# Visual Studio Code | ||
.vscode | ||
*.code-workspace | ||
|
||
# VIM | ||
*.swp | ||
*.swo | ||
|
||
docker/ | ||
no_commit/ | ||
scripts/__pycache__ |
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 @@ | ||
3.10.13 |
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,25 @@ | ||
FROM python:3.10.13 | ||
|
||
# RUN apt-get -y update && apt-get -y install \ | ||
# wget && \ | ||
# # Install the GPG key for the Postgres repo | ||
# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | ||
# # Add the repo | ||
# echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \ | ||
# apt-get -y update && \ | ||
# # Install the Postgres 12 client | ||
# apt-get -y install postgresql-client-12 | ||
|
||
# COPY requirements.txt requirements.txt | ||
COPY src/ /src | ||
|
||
# RUN pip3 install -r requirements.txt | ||
|
||
WORKDIR / | ||
COPY docker-entrypoint.sh ./ | ||
RUN chmod +x docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
# Set up the iAtlas database | ||
# CMD python /src/build_database.py |
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,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [ "$1" = 'python' ]; then | ||
cd ${APP_DIR} | ||
exec gosu www-data "$@" | ||
fi | ||
|
||
exec "$@" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 @@ | ||
[virtualenvs] | ||
in-project = true | ||
create = true |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
PYTHON_VERSION="3.10.13" | ||
|
||
pyenv install --skip-existing $PYTHON_VERSION | ||
|
||
# Initializing pyenv again solves an issue encountered by GitHub action where the version of Python | ||
# installed above is not detected. | ||
eval "$(pyenv init -)" | ||
|
||
pyenv local $PYTHON_VERSION | ||
poetry env use $PYTHON_VERSION | ||
poetry install | ||
# poetry install --with prod,dev |
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,68 @@ | ||
{ | ||
"name": "iatlas-api", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/iatlas/api/scripts", | ||
"projectType": "application", | ||
"targets": { | ||
"create-config": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "cp -n .env.example .env", | ||
"cwd": "{projectRoot}" | ||
} | ||
}, | ||
"prepare": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "./prepare-python.sh", | ||
"cwd": "{projectRoot}" | ||
} | ||
}, | ||
"serve": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "docker compose up", | ||
"cwd": "apps/iatlas/api" | ||
}, | ||
"dependsOn": [] | ||
}, | ||
"serve-detach": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "docker/iatlas/serve-detach.sh {projectName}" | ||
} | ||
}, | ||
"build-image": { | ||
"executor": "@nx-tools/nx-container:build", | ||
"options": { | ||
"context": "apps/iatlas/api", | ||
"metadata": { | ||
"images": ["ghcr.io/sage-bionetworks/{projectName}"], | ||
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] | ||
}, | ||
"push": false | ||
} | ||
}, | ||
"publish-image": { | ||
"executor": "@nx-tools/nx-container:build", | ||
"options": { | ||
"context": "apps/iatlas/api", | ||
"metadata": { | ||
"images": ["ghcr.io/sage-bionetworks/{projectName}"], | ||
"tags": ["type=edge,branch=main", "type=sha"] | ||
}, | ||
"push": true | ||
}, | ||
"dependsOn": ["build-image"] | ||
}, | ||
"scan-image": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "trivy image ghcr.io/sage-bionetworks/{projectName}:local --quiet", | ||
"color": true | ||
} | ||
} | ||
}, | ||
"tags": ["type:app", "scope:backend", "language:python"], | ||
"implicitDependencies": [] | ||
} |
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,13 @@ | ||
[tool.poetry] | ||
name = "iatlas-api" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["andrewelamb <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "3.10.13" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |