Skip to content

Commit

Permalink
Merge branch 'v1.0.x' into v1.1.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	Dockerfile
#	app.py
  • Loading branch information
liisaratsep committed Sep 13, 2021
2 parents 81b365b + ffe0aa9 commit 5c98ec6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
FROM python:3.8-alpine

# Install needed dependencies
RUN apk update \
&& apk add --no-cache \
gcc \
libffi-dev \
musl-dev \
git
# Install system dependencies
RUN apk update && \
apk add --no-cache \
gcc \
libffi-dev \
musl-dev \
git

ENV PYTHONIOENCODING=utf-8
WORKDIR /app
RUN adduser -D app; chown -R app:app /app

RUN adduser -D app && \
chown -R app:app /app
USER app
ENV PATH="/home/app/.local/bin:${PATH}"

COPY --chown=app:app requirements/requirements.txt .
RUN pip install --user -r requirements.txt && rm requirements.txt
RUN pip install --user -r requirements.txt && \
rm requirements.txt

COPY --chown=app:app . .

Expand Down
1 change: 1 addition & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
logger = logging.getLogger("gunicorn.error")

app = Nauron(__name__, timeout=settings.MESSAGE_TIMEOUT, mq_parameters=settings.MQ_PARAMETERS)
app.secret_key = settings.SECRET_KEY
CORS(app)

nmt = app.add_service(name=settings.SERVICE_NAME, remote=True)
Expand Down
3 changes: 2 additions & 1 deletion config/sample.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MQ_PORT=5672
MQ_HOST=localhost
MQ_USERNAME=guest
MQ_PASSWORD=guest
MQ_PASSWORD=guest
FLASK_SECRET_KEY=
2 changes: 2 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
load_dotenv("config/.env")
load_dotenv("config/sample.env")

SECRET_KEY = environ.get("FLASK_SECRET_KEY", None)

CONFIG_FILE = 'config/config.yaml'

with open(CONFIG_FILE, 'r', encoding='utf-8') as f:
Expand Down

0 comments on commit 5c98ec6

Please sign in to comment.