Skip to content

Commit 19554be

Browse files
committed
updates june 2020
1 parent 8a56202 commit 19554be

File tree

9 files changed

+37
-23
lines changed

9 files changed

+37
-23
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Michael Herman
3+
Copyright (c) 2020 Michael Herman
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

app/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pull official base image
2-
FROM python:3.8.0-alpine
2+
FROM python:3.8.3-alpine
33

44
# set work directory
55
WORKDIR /usr/src/app
@@ -14,14 +14,14 @@ RUN apk update \
1414

1515
# install dependencies
1616
RUN pip install --upgrade pip
17-
COPY ./requirements.txt /usr/src/app/requirements.txt
17+
COPY ./requirements.txt .
1818
RUN pip install -r requirements.txt
1919

2020
# copy entrypoint.sh
21-
COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
21+
COPY ./entrypoint.sh .
2222

2323
# copy project
24-
COPY . /usr/src/app/
24+
COPY . .
2525

2626
# run entrypoint.sh
2727
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]

app/Dockerfile.prod

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
###########
44

55
# pull official base image
6-
FROM python:3.8.0-alpine as builder
6+
FROM python:3.8.3-alpine as builder
77

88
# set work directory
99
WORKDIR /usr/src/app
@@ -19,7 +19,7 @@ RUN apk update \
1919
# lint
2020
RUN pip install --upgrade pip
2121
RUN pip install flake8
22-
COPY . /usr/src/app/
22+
COPY . .
2323
RUN flake8 --ignore=E501,F401 .
2424

2525
# install dependencies
@@ -32,7 +32,7 @@ RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requir
3232
#########
3333

3434
# pull official base image
35-
FROM python:3.8.0-alpine
35+
FROM python:3.8.3-alpine
3636

3737
# create directory for the app user
3838
RUN mkdir -p /home/app
@@ -52,7 +52,6 @@ WORKDIR $APP_HOME
5252
RUN apk update && apk add libpq
5353
COPY --from=builder /usr/src/app/wheels /wheels
5454
COPY --from=builder /usr/src/app/requirements.txt .
55-
RUN pip install --upgrade pip
5655
RUN pip install --no-cache /wheels/*
5756

5857
# copy entrypoint-prod.sh

app/entrypoint.sh

-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ fi
1313

1414
python manage.py flush --no-input
1515
python manage.py migrate
16-
python manage.py collectstatic --no-input --clear
1716

1817
exec "$@"

app/hello_django/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for hello_django project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hello_django.settings')
15+
16+
application = get_asgi_application()

app/hello_django/settings.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
Django settings for hello_django project.
33
4-
Generated by 'django-admin startproject' using Django 2.2.6.
4+
Generated by 'django-admin startproject' using Django 3.0.5.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/2.2/topics/settings/
7+
https://docs.djangoproject.com/en/3.0/topics/settings/
88
99
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/2.2/ref/settings/
10+
https://docs.djangoproject.com/en/3.0/ref/settings/
1111
"""
1212

1313
import os
@@ -17,7 +17,7 @@
1717

1818

1919
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
20+
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
2121

2222
SECRET_KEY = os.environ.get("SECRET_KEY")
2323

@@ -73,7 +73,7 @@
7373

7474

7575
# Database
76-
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
76+
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
7777

7878
DATABASES = {
7979
"default": {
@@ -88,7 +88,7 @@
8888

8989

9090
# Password validation
91-
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
91+
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
9292

9393
AUTH_PASSWORD_VALIDATORS = [
9494
{
@@ -107,7 +107,7 @@
107107

108108

109109
# Internationalization
110-
# https://docs.djangoproject.com/en/2.2/topics/i18n/
110+
# https://docs.djangoproject.com/en/3.0/topics/i18n/
111111

112112
LANGUAGE_CODE = 'en-us'
113113

@@ -121,7 +121,7 @@
121121

122122

123123
# Static files (CSS, JavaScript, Images)
124-
# https://docs.djangoproject.com/en/2.2/howto/static-files/
124+
# https://docs.djangoproject.com/en/3.0/howto/static-files/
125125

126126
STATIC_URL = "/staticfiles/"
127127
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")

app/hello_django/wsgi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
It exposes the WSGI callable as a module-level variable named ``application``.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
88
"""
99

1010
import os

app/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Django==2.2.6
2-
gunicorn==19.9.0
3-
psycopg2-binary==2.8.3
1+
Django==3.0.7
2+
gunicorn==20.0.4
3+
psycopg2-binary==2.8.5

nginx/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginx:1.17.4-alpine
1+
FROM nginx:1.19.0-alpine
22

33
RUN rm /etc/nginx/conf.d/default.conf
44
COPY nginx.conf /etc/nginx/conf.d

0 commit comments

Comments
 (0)