-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
138 additions
and
31 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
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
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,46 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
container_name: dev-env | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Dockerfile | ||
args: | ||
# Update 'VARIANT' to pick a version of Python: 3, 3.10, 3.9, 3.8, 3.7, 3.6 | ||
# Append -bullseye or -buster to pin to an OS version. | ||
# Use -bullseye variants on local arm64/Apple Silicon. | ||
VARIANT: "3.8" | ||
# Optional Node.js version to install | ||
NODE_VERSION: "lts/*" | ||
|
||
volumes: | ||
- ..:/workspace:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
network_mode: service:db | ||
# Uncomment the next line to use a non-root user for all processes. | ||
# user: vscode | ||
|
||
env_file: | ||
- ../.dev.env | ||
|
||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
db: | ||
image: postgres:latest | ||
container_name: dev-db | ||
restart: unless-stopped | ||
volumes: | ||
- postgresql:/var/lib/postgresql/data | ||
env_file: | ||
- ../.dev-db.env | ||
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace. | ||
|
||
volumes: | ||
postgresql: |
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
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,38 @@ | ||
################ | ||
# venv builder # | ||
################ | ||
FROM python:3.8.3 as venv_builder | ||
|
||
COPY requirements.txt . | ||
RUN python3 -m venv /opt/venv | ||
RUN /opt/venv/bin/pip install -r requirements.txt | ||
|
||
########### | ||
# CHP API # | ||
########### | ||
FROM python:3.8.3-slim as chp-api | ||
|
||
# set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV TZ=America/New_York | ||
ENV SERVER_DIR=/chp_api/ | ||
ENV VIRTUAL_ENV_PATH=/opt/venv | ||
|
||
# copy venv from venv builder image | ||
COPY --from=venv_builder ${VIRTUAL_ENV_PATH} ${VIRTUAL_ENV_PATH} | ||
|
||
# copy project | ||
COPY ./chp_api $SERVER_DIR | ||
|
||
# copy entry point | ||
COPY ./entrypoint.sh ${SERVER_DIR} | ||
|
||
# enter app directory | ||
WORKDIR $SERVER_DIR | ||
|
||
# Enable venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
# run server | ||
# ENTRYPOINT ["./entrypoint.sh"] | ||
CMD ["python", "manage.py", "runserver"] |
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 @@ | ||
version: '3.8' | ||
|
||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: chp-api | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
volumes: | ||
- static_volume:/chp_api/staticfiles | ||
expose: | ||
- 80 | ||
env_file: | ||
- ./.dev.env | ||
db: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
volumes: | ||
- ../chp.sql:/var/lib/postgresql/data | ||
env_file: | ||
- .dev-db.env | ||
|
||
volumes: | ||
static_volume: |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
chp_learn @ git+https://github.com/di2ag/chp_learn.git@master | ||
chp_utils @ git+https://github.com/di2ag/chp_utils.git@master | ||
trapi_model @ git+https://github.com/di2ag/trapi_model.git@master | ||
chp_look_up @ git+https://github.com/di2ag/chp_look_up.git@master | ||
gene-specificity @ git+https://github.com/di2ag/gene-specificity.git@master | ||
chp_learn @ git+https://github.com/di2ag/chp_learn.git@master | ||
chp_utils @ git+https://github.com/di2ag/chp_utils.git@master | ||
trapi_model @ git+https://github.com/di2ag/trapi_model.git@master | ||
chp_look_up @ git+https://github.com/di2ag/chp_look_up.git@master | ||
gene-specificity @ git+https://github.com/di2ag/gene-specificity.git@master | ||
reasoner-validator @ git+https://github.com/di2ag/reasoner-validator.git@master |