Skip to content

Commit

Permalink
Merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Romulus10 committed May 13, 2022
2 parents be988e1 + 9dda872 commit 2b3487d
Show file tree
Hide file tree
Showing 170 changed files with 2,643 additions and 2,404 deletions.
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": []

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
141 changes: 141 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
version: '3'

services:
nginx:
build: ./nginx
ports:
- "80:80"
volumes:
- staticvol:/opt/app/static
- mediavol:/opt/app/mediafiles
depends_on:
- "dev"

database:
image: "postgres"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- db:/var/lib/postgresql/data
ports:
- "5432:5432"

dev:
build:
context: .
dockerfile: Dockerfile
entrypoint: "./build-dev.sh"
volumes:
- .:/build
- staticvol:/opt/app/static
- mediavol:/opt/app/mediafiles
ports:
- "8081:8081"
environment:
- DEBUG=True
- QLDB_ENABLED="FALSE"
- qldb_name="fEMR-OnChain-Test"
- ADMIN_NAME=""
- ADMIN_EMAIL=""
- EMAIL_HOST=""
- EMAIL_PORT=""
- EMAIL_USERNAME=""
- EMAIL_PASSWORD=""
- DEFAULT_FROM_EMAIL=""
- SERVER_EMAIL=""
- ENVIRONMENT="LOCAL"
- SECRET_KEY=2HY>fXi!dQ&(9Vf.XghCa;L6G=Ul4r-Bwqh>ae0RG3vIh1ZJ%T
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- POSTGRES_NAME=database
- ENVIRONMENT=LOCAL
depends_on:
- "database"
- "cache"

celery_beat:
build:
context: .
dockerfile: Dockerfile-celery
volumes:
- .:/build
entrypoint: "./build-celery-beat.sh"
environment:
- DEBUG=True
- QLDB_ENABLED="FALSE"
- qldb_name="fEMR-OnChain-Test"
- ADMIN_NAME=""
- ADMIN_EMAIL=""
- EMAIL_HOST=""
- EMAIL_PORT=""
- EMAIL_USERNAME=""
- EMAIL_PASSWORD=""
- DEFAULT_FROM_EMAIL=""
- SERVER_EMAIL=""
- ENVIRONMENT="LOCAL"
- SECRET_KEY=2HY>fXi!dQ&(9Vf.XghCa;L6G=Ul4r-Bwqh>ae0RG3vIh1ZJ%T
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- POSTGRES_NAME=database
- ENVIRONMENT=LOCAL
depends_on:
- "dev"
- "redis"
- "database"

celery:
build:
context: .
dockerfile: Dockerfile-celery
volumes:
- .:/build
entrypoint: "./build-celery.sh"
environment:
- DEBUG=True
- QLDB_ENABLED="FALSE"
- qldb_name="fEMR-OnChain-Test"
- ADMIN_NAME=""
- ADMIN_EMAIL=""
- EMAIL_HOST=""
- EMAIL_PORT=""
- EMAIL_USERNAME=""
- EMAIL_PASSWORD=""
- DEFAULT_FROM_EMAIL=""
- SERVER_EMAIL=""
- ENVIRONMENT="LOCAL"
- SECRET_KEY=2HY>fXi!dQ&(9Vf.XghCa;L6G=Ul4r-Bwqh>ae0RG3vIh1ZJ%T
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- POSTGRES_NAME=database
- ENVIRONMENT=LOCAL
depends_on:
- "dev"
- "redis"
- "database"

redis:
image: redis:6-alpine
ports:
- "6379:6379"

cache:
image: memcached
ports:
- "11211:11211"
entrypoint:
- memcached
- -m 64

volumes:
db:
staticvol:
mediavol:
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
python-version: 3.9
- name: Install dependencies
run: |
sudo apt install libmemcached-dev
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
export/
env/
.vs/
venv/
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM amd64/ubuntu:latest

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update -y && \
Expand All @@ -10,10 +10,9 @@ RUN DEBIAN_FRONTEND=noninteractive \
libmemcached-dev \
virtualenv libpq-dev -y && \
apt-get upgrade -y
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install nodejs -y
RUN pip install sphinx
RUN apt-get update && apt-get install -y dos2unix

COPY requirements.txt /opt/app/requirements.txt
RUN mkdir /opt/app/static
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile-celery
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM amd64/ubuntu:latest

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update -y && \
Expand All @@ -10,10 +10,9 @@ RUN DEBIAN_FRONTEND=noninteractive \
libmemcached-dev \
virtualenv libpq-dev -y && \
apt-get upgrade -y
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install nodejs -y
RUN pip install sphinx
RUN apt-get update && apt-get install -y dos2unix

COPY requirements.txt /opt/app/requirements.txt
WORKDIR /opt/app
Expand All @@ -22,4 +21,4 @@ RUN pip3 install -r requirements.txt
EXPOSE 8081

ARG FOO
COPY . /opt/app
COPY . /opt/app
2 changes: 1 addition & 1 deletion app_mr
Submodule app_mr updated 3 files
+12 −0 decorators.py
+148 −1 test/test_views.py
+146 −161 views.py
3 changes: 3 additions & 0 deletions build-celery-beat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
/opt/app/build.sh all
celery --app=femr_onchain beat --loglevel=info
6 changes: 1 addition & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ export ENVIRONMENT=$ENVIRONMENT
function all() {
migrate
pip3 install -r requirements.txt
python3 -m safety check -r requirements.txt
python3 manage.py check
static
run_tests
pushd ./main/static/main/js || exit
npm install
popd || exit
Expand Down Expand Up @@ -106,7 +103,7 @@ function check() {
# that PyLint can't see.
clear && \
black . && \
./build.sh test && \
run_tests && \
pylint main app_mr clinic_messages --disable=E1101,W0613,R0903,C0301,C0114,C0115,C0116,R0801
}

Expand Down Expand Up @@ -157,7 +154,6 @@ setup)
;;

init-all-run)
check
all
setup
gunicorn_run
Expand Down
2 changes: 1 addition & 1 deletion clinic_messages
Loading

0 comments on commit 2b3487d

Please sign in to comment.