Skip to content

Get branch on same track #94

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

Merged
merged 13 commits into from
Jun 20, 2022
Merged
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
12 changes: 6 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 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.202.5/containers/docker-existing-dockerfile
{
"name": "ehroesdev",
"build": { "args": { "-t": "ehroesdev:latest" } },
"name": "impatientdev",
"build": { "args": { "-t": "impatientdev:latest" } },
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

Expand Down Expand Up @@ -36,10 +36,10 @@
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ehroes,type=bind,consistency=cached",
"workspaceFolder": "/home/ehroes",
"runArgs": ["--init", "--name", "ehroesdev", "--rm", "-it"],
"workspaceMount": "source=${localWorkspaceFolder},target=/home/impatient,type=bind,consistency=cached",
"workspaceFolder": "/home/impatient",
"runArgs": ["--init", "--name", "impatientdev", "--rm", "-it"],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "ehroes"
"remoteUser": "impatient"
}
2 changes: 1 addition & 1 deletion .flaskenv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FLASK_APP=ehroes.py
FLASK_APP=impatient.py
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/ehroes:latest
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/impatient:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@ docker/run.sh
.config
.gitconfig
*.tar.gz
EHRoes
IMPatienT
!data/images/demo_patient
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
rev: v1.0.5
Expand Down
25 changes: 21 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"version": "1.0.0",
"configurations": [
{
"name": "Debug Flask App",
"name": "Debug Flask App (Docker)",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"python": {
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/ehroes"
"remoteRoot": "/home/impatient"
}
],
"projectType": "flask"
Expand All @@ -22,7 +22,24 @@
"action": "openExternally",
"pattern": "Running on (http?://\\S+|[0-9]+)",
"uriFormat": "%s://localhost:%s/"
}
}
},
},
{
"name": "Debug Flask App (Linux)",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "impatient.py",
"FLASK_ENV": "development",
"FLASK_DEBUG": "0"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
]
}
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"label": "docker-run: debug",
"dependsOn": ["docker-build"],
"dockerRun": {
"containerName": "ehroesdev",
"image": "ehroesdev:latest",
"containerName": "impatientdev",
"image": "impatientdev:latest",
"env": {
"FLASK_APP": "/home/ehroes/ehroes.py",
"FLASK_APP": "/home/impatient/impatient.py",
"FLASK_ENV": "development"
},
"volumes": [
{
"containerPath": "/home/ehroes",
"containerPath": "/home/impatient",
"localPath": "${workspaceFolder}"
}
],
Expand All @@ -36,7 +36,7 @@
"dockerBuild": {
"context": "${workspaceFolder}",
"dockerfile": "${workspaceFolder}/Dockerfile.dev",
"tag": "ehroesdev:latest"
"tag": "impatientdev:latest"
}
}
]
Expand Down
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
FROM python:3.9-slim

RUN useradd ehroes
WORKDIR /home/ehroes
RUN useradd impatient
WORKDIR /home/impatient

RUN apt update && apt install -y gcc git tesseract-ocr tesseract-ocr-osd tesseract-ocr-fra poppler-utils
COPY --chown=ehroes:ehroes pyproject.toml pyproject.toml
COPY --chown=ehroes:ehroes poetry.lock poetry.lock
COPY --chown=impatient:impatient pyproject.toml pyproject.toml
COPY --chown=impatient:impatient poetry.lock poetry.lock

RUN python -m pip install poetry
RUN python -m poetry config virtualenvs.create false
RUN python -m poetry install --no-root --no-interaction && rm -rf ~/.cache/pypoetry/{cache,artifacts}

COPY --chown=ehroes:ehroes ehroes.py config.py docker/boot.sh ./
COPY --chown=ehroes:ehroes app app
COPY --chown=ehroes:ehroes migrations migrations
COPY --chown=ehroes:ehroes config config
COPY --chown=impatient:impatient impatient.py config.py docker/boot.sh ./
COPY --chown=impatient:impatient app app
COPY --chown=impatient:impatient migrations migrations
COPY --chown=impatient:impatient config config

RUN chown ehroes:ehroes /home/ehroes
RUN chown impatient:impatient /home/impatient
RUN chmod a+x boot.sh

ENV FLASK_APP ehroes.py
ENV FLASK_APP impatient.py

RUN usermod -u 1000 ehroes
RUN usermod -G staff ehroes
USER ehroes
RUN usermod -u 1000 impatient
RUN usermod -G staff impatient
USER impatient

EXPOSE 5000
ENTRYPOINT ["./boot.sh"]
14 changes: 7 additions & 7 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
FROM python:3.9-slim

RUN useradd ehroes
WORKDIR /home/ehroes
RUN useradd impatient
WORKDIR /home/impatient

RUN apt update && apt install -y gcc git tesseract-ocr tesseract-ocr-osd tesseract-ocr-fra poppler-utils
COPY --chown=ehroes:ehroes pyproject.toml pyproject.toml
COPY --chown=ehroes:ehroes poetry.lock poetry.lock
COPY --chown=impatient:impatient pyproject.toml pyproject.toml
COPY --chown=impatient:impatient poetry.lock poetry.lock

RUN python -m pip install poetry
RUN python -m poetry config virtualenvs.create false
RUN python -m poetry install --no-root --no-interaction && rm -rf ~/.cache/pypoetry/{cache,artifacts}

RUN chown ehroes:ehroes /home/ehroes
RUN chown impatient:impatient /home/impatient

ENV FLASK_ENV development
ENV FLASK_APP ehroes.py
ENV FLASK_APP impatient.py
ENV SHELL /bin/bash

USER ehroes
USER impatient

EXPOSE 5000
ENTRYPOINT ["./dev_boot.sh"]
Loading