Skip to content
Open
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
8 changes: 4 additions & 4 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
runs-on: ubuntu-20.04
container: fedora:36
steps:
- name: Install Pipenv and Git
run: dnf install -y pipenv git
- name: Install Git
run: dnf install -y git pip
- name: Checkout code
uses: actions/checkout@v2
- name: Setup environment
run: pipenv sync --dev
run: pip install -r requirements.txt
- name: Run Flake8
run: pipenv run flake8 --max-line-length 120
run: flake8 --max-line-length 120
8 changes: 4 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
runs-on: ubuntu-20.04
container: fedora:36
steps:
- name: Install Pipenv and Git
run: dnf install -y pipenv git
- name: Install Git
run: dnf install -y git pip
- name: Checkout code
uses: actions/checkout@v2
- name: Setup environment
run: pipenv sync --dev
run: pip install -r requirements.txt
- name: Run PyTest
run: pipenv run pytest -v
run: pytest -v
25 changes: 25 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# fedora-36
FROM registry.fedoraproject.org/fedora:36

WORKDIR /vagrant

COPY requirements.txt /vagrant

RUN \
dnf -y install \
# python3 \
sqlite \
pip \
gcc \
python3-devel \
&& \
dnf clean all

RUN \
python3 -m pip install -r requirements.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please build a version that uses pipenv - requirements.txt is not an adequate replacement.

try using Red Hat's Python s2i image.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this
https://github.com/sclorg/s2i-python-container/blob/master/3.6/README.md
It is very interesting but not clear for me,

I see an option for django pipenv and for release gunicorn option,
Could be that i need more guidance here

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


COPY app_setup.sh /vagrant

ENTRYPOINT /bin/bash /vagrant/app_setup.sh

EXPOSE 8000/tcp
15 changes: 0 additions & 15 deletions Pipfile

This file was deleted.

149 changes: 0 additions & 149 deletions Pipfile.lock

This file was deleted.

77 changes: 0 additions & 77 deletions Vagrantfile

This file was deleted.

9 changes: 5 additions & 4 deletions app_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

# Install Pipenv, the -n option makes sudo fail instead of asking for a
# password if we don’t have sufficient privileges to run it
sudo -n dnf install -y pipenv
#sudo -n dnf install -y pipenv

cd /vagrant
# Install dependencies with Pipenv
pipenv sync
#pipenv sync

# Run database migrations
pipenv run python manage.py migrate
python3 manage.py migrate

# run our app. Nohup and “&” are used to let the setup script finish
# while our app stays up. The app logs will be collected in nohup.out

(setsid pipenv run python manage.py runserver 0.0.0.0:8000 > runserver.log 2>&1 &)
#(setsid python3 manage.py runserver 0.0.0.0:8000 > runserver.log 2>&1 )&
python3 manage.py runserver 0.0.0.0:8000 > runserver.log 2>&1
Copy link

@ifireball ifireball Dec 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't output the logs to a file - when running in a container you want to have the logs be tracked by the runtime.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

32 changes: 32 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Base: ubi9

# Django
asgiref==3.5.0
Django==4.0.3
sqlparse==0.4.2

# pytest
attrs==21.4.0
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.0.7
pytest==7.1.0
pytest-django==4.5.2
tomli==2.0.1

# linters
## flake8
flake8==4.0.1
mccabe==0.6.1
pycodestyle==2.8.0
pyflakes==2.4.0

# black (formatter)
black==22.1.0
click==8.0.4
mypy-extensions==0.4.3
pathspec==0.9.0
platformdirs==2.5.1
typing-extensions==4.1.1