Skip to content
Open
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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
venv
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
FlaskApp.wsgi
Working
README.md
datas
target
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
### STAGE 1:BUILD ###
FROM python:3.10-slim AS build
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential gcc

WORKDIR /usr/app
RUN python -m venv /usr/app/venv
ENV PATH="/usr/app/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip install gunicorn

### STAGE 2:RUN ###
FROM python:3.10-slim

RUN groupadd -g 999 python && \
useradd -r -u 999 -g python python

RUN mkdir /usr/app && chown python:python /usr/app
WORKDIR /usr/app

COPY --chown=python:python --from=build /usr/app/venv ./venv
COPY --chown=python:python . .

USER 999

ENV DATA_ENV remote
ENV FLASK_ENV production
ENV ELASTIC_URL https://localhost:9200/
ENV ELASTIC_USER ${ELASTIC_USER}
ENV ELASTIC_PASS ${ELASTIC_PASS}

ENV PATH="/usr/app/venv/bin:$PATH"
CMD [ "gunicorn", "--bind", "0.0.0.0:5000", "wsgi" ]
EXPOSE 5000
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3.9"
services:
elasticsearch:
container_name: es
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
environment:
- xpack.security.enabled=false
- "discovery.type=single-node"
networks:
- orpha-net
ports:
- 9200:9200
orphadata:
container_name: api-orphadata
image: orphanet/orphadata
environment:
- ELASTIC_URL=http://es:9200
- ELASTIC_USER=elastic
- ELASTIC_PASS=changeme
networks:
- orpha-net
depends_on:
- elasticsearch
ports:
- 5000:5000
networks:
orpha-net:
driver: bridge