Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nbuonin committed Nov 24, 2019
0 parents commit a03d5c4
Show file tree
Hide file tree
Showing 22 changed files with 1,051 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.venv
db.sqlite3
media
node_modules
local.py
reset_import.sh
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.7-slim
LABEL maintainer="[email protected]"

ENV PYTHONUNBUFFERED 1
ENV PIPENV_VENV_IN_PROJECT 1
EXPOSE 8000

RUN apt-get update
RUN apt-get install libglib2.0-0 -y
RUN pip3 install pipenv
COPY . /app/
WORKDIR /app/

RUN set -ex && \
pipenv sync && \
useradd wagtail && \
chown -R wagtail /app

USER wagtail

CMD pipenv run ./manage.py collectstatic --noinput --settings=decruck.settings.production && \
pipenv run ./manage.py migrate --settings=decruck.settings.production && \
pipenv run gunicorn --bind 0.0.0.0:8000 --workers 3 --forwarded-allow-ips="*" decruck.wsgi:application
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
PY_SENTINAL = .venv/sentinal
JS_SENTINAL = node_modules/sentinal
PIPFILE = Pipfile

$(PY_SENTINAL): $(PIPFILE)
-rm -rf .venv
pipenv sync
touch $@

$(JS_SENTINAL):
-rm -rf node_modules
npm install
touch $@

clean:
-rm -rf .venv node_modules

runserver: $(PY_SENTINAL)
pipenv run ./manage.py runserver

migrate: $(PY_SENTINAL)
pipenv run ./manage.py migrate

makemigrations: $(PY_SENTINAL)
pipenv run ./manage.py makemigrations

superuser: $(PY_SENTINAL)
pipenv run ./manage.py createsuperuser

shell: $(PY_SENTINAL)
pipenv run ./manage.py shell

test: $(PY_SENTINAL)
pipenv run ./manage.py test

scss: $(JS_SENTINAL)
npm run watch-scss

docker-image:
docker build -t nbuonin/decruck:`git log -n 1 --pretty="%h"` .

docker-test:
cd docker && docker-compose up --build --abort-on-container-exit

docker-push:
docker push nbuonin/decruck:`git log -n 1 --pretty="%h"`

.PHONY: clean runserver migrate makemigrations superuser shell test scss docker-image docker-test docker-push
29 changes: 29 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
wagtail = "==2.6.1"
wagtail-autocomplete = "==0.3.1"
faker = "==2.0.1"
factory-boy = "==2.12.0"
wagtail-factories = "==2.0.0"
gunicorn = "==19.9.0"
django-el-pagination = "==3.2.4"
wagtailmenus = "==2.13.1"
psycopg2-binary = "==2.8.3"
django-paypal = "==1.0.0"
django-storages = "==1.7.1"
boto3 = "==1.9.199"
opencv-python-headless = "==4.1.0.25"
pylint = "==2.3.1"
flake8 = "==3.7.8"
pylint-django = "==2.0.11"
wagtail-metadata = "==2.0.1"
sentry-sdk = "==0.11.1"

[dev-packages]

[requires]
python_version = "3.7"
Loading

0 comments on commit a03d5c4

Please sign in to comment.