8000 feat: update to latest ubi by gee4vee · Pull Request #92 · IBM/python-flask-app · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

feat: update to latest ubi #92

Merged
merged 2 commits into from
May 21, 2021
Merged
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Dockerfile
Dockerfile-tools
Pipfile.lock

14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM registry.access.redhat.com/ubi8:8.3
FROM registry.access.redhat.com/ubi8/python-39:1

WORKDIR /app
WORKDIR /opt/app-root/src

COPY Pipfile* /app/
COPY Pipfile* /opt/app-root/src/

## NOTE - rhel enforces user container permissions stronger ##
USER root
RUN yum -y install python3
RUN yum -y install python3-pip wget

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install --upgrade pipenv \
&& pipenv install --system --deploy
&& pipenv install --deploy

RUN pipenv lock -r > requirements.txt && pip3 install -r requirements.txt

USER 1001

COPY . /app
COPY . /opt/app-root/src
ENV FLASK_APP=server/__init__.py
ENV PORT 3000

Expand Down
16 changes: 7 additions & 9 deletions Dockerfile-tools
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
# Use base UBI image
FROM registry.access.redhat.com/ubi8/ubi
FROM registry.access.redhat.com/ubi8/python-39:1

WORKDIR /app
WORKDIR /opt/app-root/src

COPY Pipfile* /app/
COPY Pipfile* /opt/app-root/src/

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

RUN yum -y install --disableplugin=subscription-manager python3-pip wget \
RUN yum -y install --disableplugin=subscription-manager wget \
&& yum --disableplugin=subscription-manager clean all

RUN pip3 install pipenv
RUN pipenv install
RUN pipenv install --deploy
RUN pipenv lock -r > requirements.txt && pip3 install -r requirements.txt

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

ENV FLASK_APP=server/__init__.py
ENV FLASK_DEBUG=true

COPY . /app
COPY . /opt/app-root/src
COPY run-dev /bin
RUN chmod 777 /bin/run-dev

Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
livereload = "*"

[packages]
gunicorn = "==20.1.0"
ibmcloudenv = "*"
livereload = "*"
flask = ">=1.0.0"
prometheus_client = "*"
flasgger = "*"
148 changes: 84 additions & 64 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0