Skip to content

Commit a553e5b

Browse files
author
jmrivas
committed
- Fixed Dockerfile chmod
- Added database dir for sqlite - Added config-docker.yml
1 parent cb15197 commit a553e5b

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ RUN apk add --update curl gcc g++ git libffi-dev openssl-dev python3-dev build-b
55
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
66

77
ENV PYTHONUNBUFFERED=1 ENVIRONMENT=pre APP_HOME=/microservice/
8-
ENV CONFIGMAP_FILE="$APP_HOME"tests/config-tests.yml
8+
ENV DATABASE_DIR=database
9+
ENV CONFIGMAP_FILE="$APP_HOME"config-docker.yml
910
RUN mkdir $APP_HOME && adduser -S -D -H python
1011

1112
RUN chown -R python $APP_HOME
12-
RUN chmod 777 $APP_HOME
1313
WORKDIR $APP_HOME
14-
ADD requirement*.txt $APP_HOME
15-
RUN pip install -r requirements-docker.txt
1614
ADD . $APP_HOME
15+
RUN mkdir $DATABASE_DIR
16+
RUN chmod 777 $DATABASE_DIR
17+
RUN ls -lah
18+
RUN pip install --upgrade pip
19+
RUN pip install -r requirements-docker.txt
1720

1821
EXPOSE 5000
1922
USER python

config-docker.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ms:
2+
DEBUG: false
3+
TESTING: false
4+
APP_NAME: Template
5+
APPLICATION_ROOT : ''
6+
SQLALCHEMY_TRACK_MODIFICATIONS: true
7+
SECRET_KEY: "gjr39dkjn344_!67#"
8+
DATABASE: db.sqlite3
9+
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ms:
66
SQLALCHEMY_TRACK_MODIFICATIONS: true
77
SECRET_KEY: "gjr39dkjn344_!67#"
88
DATABASE: db.sqlite3
9-
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/db.sqlite3
9+
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3

tests/config-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ms:
66
SQLALCHEMY_TRACK_MODIFICATIONS: true
77
SECRET_KEY: "gjr39dkjn344_!67#"
88
DATABASE: db_test.sqlite3
9-
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/db_test.sqlite3
9+
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db_test.sqlite3

0 commit comments

Comments
 (0)