8000 Merge pull request #93 from IBM/development · neotycoder/python-flask-app@865b39b · GitHub
[go: up one dir, main page]

Skip to content

Commit 865b39b

Browse files
authored
Merge pull request IBM#93 from IBM/development
feat: update to latest ubi (IBM#92)
2 parents eed237d + 8709b34 commit 865b39b

File tree

5 files changed

+101
-81
lines changed

5 files changed

+101
-81
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
Dockerfile
22
Dockerfile-tools
3+
Pipfile.lock
4+

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
FROM registry.access.redhat.com/ubi8:8.3
1+
FROM registry.access.redhat.com/ubi8/python-39:1
22

3-
WORKDIR /app
3+
WORKDIR /opt/app-root/src
44

5-
COPY Pipfile* /app/
5+
COPY Pipfile* /opt/app-root/src/
66

77
## NOTE - rhel enforces user container permissions stronger ##
88
USER root
9-
RUN yum -y install python3
10-
RUN yum -y install python3-pip wget
119

1210
RUN python3 -m pip install --upgrade pip \
1311
&& python3 -m pip install --upgrade pipenv \
14-
&& pipenv install --system --deploy
12+
&& pipenv install --deploy
13+
14+
RUN pipenv lock -r > requirements.txt && pip3 install -r requirements.txt
1515

1616
USER 1001
1717

18-
COPY . /app
18+
COPY . /opt/app-root/src
1919
ENV FLASK_APP=server/__init__.py
2020
ENV PORT 3000
2121

Dockerfile-tools

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# Use base UBI image
2-
FROM registry.access.redhat.com/ubi8/ubi
2+
FROM registry.access.redhat.com/ubi8/python-39:1
33

4-
WORKDIR /app
4+
WORKDIR /opt/app-root/src
55

6-
COPY Pipfile* /app/
6+
COPY Pipfile* /opt/app-root/src/
77

8-
# Install python3
9-
RUN yum -y install --disableplugin=subscription-manager python36 \
10-
&& yum --disableplugin=subscription-manager clean all
118

12-
RUN yum -y install --disableplugin=subscription-manager python3-pip wget \
9+
RUN yum -y install --disableplugin=subscription-manager wget \
1310
&& yum --disableplugin=subscription-manager clean all
1411

1512
RUN pip3 install pipenv
16-
RUN pipenv install
13+
RUN pipenv install --deploy
14+
RUN pipenv lock -r > requirements.txt && pip3 install -r requirements.txt
1715

1816
# Update python command to point to python3 install
1917
RUN alternatives --set python /usr/bin/python3
2018

2119
ENV FLASK_APP=server/__init__.py
2220
ENV FLASK_DEBUG=true
2321

24-
COPY . /app
22+
COPY . /opt/app-root/src
2523
COPY run-dev /bin
2624
RUN chmod 777 /bin/run-dev
2725

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
livereload = "*"
78

89
[packages]
910
gunicorn = "==20.1.0"
1011
ibmcloudenv = "*"
11-
livereload = "*"
1212
flask = ">=1.0.0"
1313
prometheus_client = "*"
1414
flasgger = "*"

Pipfile.lock

Lines changed: 84 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0