Skip to content

Commit

Permalink
Merge pull request #5 from python-microservices/feature/changes-docke…
Browse files Browse the repository at this point in the history
…rfile

- Updated Dockerfile
  • Loading branch information
jmrivas86 committed Nov 14, 2018
2 parents 55afc19 + fa6ad1d commit 488f4cc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[run]
include=
*project/*
*pyms/*
omit =
venv/*
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
FROM python:3.6.4-alpine3.7

RUN apk add --update curl gcc g++ git libffi-dev openssl-dev python3-dev \
RUN apk add --update curl gcc g++ git libffi-dev openssl-dev python3-dev build-base linux-headers \
&& rm -rf /var/cache/apk/*
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h

ENV PYTHONUNBUFFERED=1 ENVIRONMENT=pre APP_HOME=/microservice/
RUN mkdir $APP_HOME && adduser -S -D -H python
ENV DATABASE_DIR=database
ENV CONFIGMAP_FILE="$APP_HOME"config-docker.yml

RUN mkdir $APP_HOME && adduser -S -D -H python
RUN chown -R python $APP_HOME
WORKDIR $APP_HOME

ADD requirement*.txt $APP_HOME
RUN pip install --upgrade pip
RUN pip install -r requirements-docker.txt

ADD . $APP_HOME
RUN mkdir $DATABASE_DIR
RUN chmod 777 $DATABASE_DIR

EXPOSE 5000
USER python
Expand Down
9 changes: 9 additions & 0 deletions config-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ms:
DEBUG: false
TESTING: false
APP_NAME: Template
APPLICATION_ROOT : /template
SQLALCHEMY_TRACK_MODIFICATIONS: true
SECRET_KEY: "gjr39dkjn344_!67#"
DATABASE: db.sqlite3
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ ms:
SQLALCHEMY_TRACK_MODIFICATIONS: true
SECRET_KEY: "gjr39dkjn344_!67#"
DATABASE: db.sqlite3
SQLALCHEMY_DATABASE_URI: sqlite:///db.sqlite3
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3
1 change: 1 addition & 0 deletions requirements-docker.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-r requirements.txt
gevent==1.3.7
gunicorn==19.9.0
psutil==5.4.8
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Flask-SQLAlchemy==2.3.2
py-ms==0.1.1
SQLAlchemy==1.2.14
SQLAlchemy==1.2.14
Flask-Script==2.0.6
# py-ms==0.1.1
git+https://github.com/python-microservices/pyms.git@master#egg=py-ms
connexion[swagger-ui]==2.0.1

0 comments on commit 488f4cc

Please sign in to comment.