Refactor Dockerfile + use pipenv

This commit is contained in:
Gabriel Augendre 2018-04-02 12:57:25 +02:00
parent 7435d99217
commit 10d80e3e15
No known key found for this signature in database
GPG key ID: F360212F958357D4
3 changed files with 151 additions and 10 deletions

View file

@ -7,19 +7,22 @@ RUN apk add --no-cache tzdata && \
RUN apk add --no-cache postgresql-dev gcc musl-dev
WORKDIR /app
COPY requirements.txt /app
RUN pip3 install -r requirements.txt
COPY . /app
EXPOSE 8000
VOLUME /app/staticfiles
ENV DATABASE_URL postgres://postgresql:postgresql@db:5432/refunds
RUN pip3 install pipenv
COPY Pipfile Pipfile.lock ./
RUN pipenv install
EXPOSE 8000
COPY . ./
RUN chmod +x bash/run-prod.sh
CMD bash/run-prod.sh
CMD /app/bash/run-prod.sh
ENV DATABASE_URL postgres://postgresql:postgresql@db:5432/refunds
ENV SECRET_KEY ''
ENV MAILGUN_ACCESS_KEY ''
ENV MAILGUN_SERVER_NAME ''
ENV DJANGO_ENV ''
ENV ADMIN_EMAIL ''
ENV SERVER_EMAIL ''

27
Pipfile Normal file
View file

@ -0,0 +1,27 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
dj-database-url = "==0.4.1"
Django = "==1.10"
"django-bootstrap3-datetimepicker-2" = "==2.4.2"
django-crispy-forms = "==1.6.0"
django-dotenv = "==1.4.1"
gunicorn = "==19.6.0"
"psycopg2" = "==2.6.2"
pytz = "*"
whitenoise = "==3.2.1"
[dev-packages]
[requires]
python_version = "3.6"

111
Pipfile.lock generated Normal file
View file

@ -0,0 +1,111 @@
{
"_meta": {
"hash": {
"sha256": "5056eec97b25e04ba40b4bae59bfd5a26fb22bb0525a7915320fbf837050a2c8"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
"dj-database-url": {
"hashes": [
"sha256:7f4c78d2a090df8dfaf56d5d3ff7bbee17360436e4879558317e2314424864cd"
],
"index": "pypi",
"version": "==0.4.1"
},
"django": {
"hashes": [
"sha256:46b868d68e5fd69dd9e05a0a7900df91786097e30b2aa6f065dd7fa3b22f7005",
"sha256:9c60f4a801bf7c26bd6824c1062550c12c373344116703461c18cc258f8c9320"
],
"index": "pypi",
"version": "==1.10"
},
"django-bootstrap3-datetimepicker-2": {
"hashes": [
"sha256:c6260f701d3d950c121ca9e7694cc97e7de38d733d4ed0a541e62e233a21b9fc"
],
"index": "pypi",
"version": "==2.4.2"
},
"django-crispy-forms": {
"hashes": [
"sha256:18758a8baae8324c59dbc2ba6aad4e375cdb94bea638c45d6f45aeb029d0d142",
"sha256:67fbb7194bd9887d663161405c623f5f5cd3f9ee627515c4de7a50e16fa44ed1"
],
"index": "pypi",
"version": "==1.6.0"
},
"django-dotenv": {
"hashes": [
"sha256:2930f6b0c0955ac150e1ca9ac01e84afa71efdbb544dea7155f026e20e401305",
"sha256:f9e24f89a21f2b1ee010e903f9df5102b0c6c9174e629b07ca2f1a243bb68a3d"
],
"index": "pypi",
"version": "==1.4.1"
},
"gunicorn": {
"hashes": [
"sha256:723234ea1fa8dff370ab69830ba8bc37469a7cba13fd66055faeef24085e6530",
"sha256:813f6916d18a4c8e90efde72f419308b357692f81333cb1125f80013d22fb618"
],
"index": "pypi",
"version": "==19.6.0"
},
"psycopg2": {
"hashes": [
"sha256:1ee3f027684db469e3aafa9d4897ed1ca19c599b772e12dca7e61ed1b30ce26e",
"sha256:224bd45f838f8a714b8e711b4167158d86d01f398c678c46330caf59684a608f",
"sha256:48c1648d090ca72cf430920fb62f138cd02f9d2b035d2d2654af0a38f28bdc27",
"sha256:53973aea916a92a172e46b3181fc8f904c9013ae17513ee3029386084449ef07",
"sha256:60f29f91a88fe7c2d1eb7fb64f3ea99b0bd3d06ea7169e187ccb2cb653f91311",
"sha256:6b6f745fb3a94a8d48b2e225e14808768ed33c52993ad6319b8f9cb972fec4dd",
"sha256:70490e12ed9c5c818ecd85d185d363335cc8a8cbf7212e3c185431c79ff8c05c",
"sha256:83afd42c95ac9e745ba9dcd28c20142ffa85a2ecc628d40fdc85342018ac016b",
"sha256:863fae11c31f5a7b9ce1e738149793214aad36cff4ca92d7111562e2fdbd7b57",
"sha256:8c3b69d743e408527208d5ed6aa136b821bbd3cb1e236aa8479ff47ea986769c",
"sha256:8ffbd1128df23c9fdfc3499084021055b3df7818f12ef87af5b3f33e27d58b0a",
"sha256:bbc1c4065598146fe804bc0bc23c78429f1cf802ac6290518a371682a1569c4b",
"sha256:c367d51de53bbe92c5f56dfc32278de79bbe706e64796306a44a6097130fdf84",
"sha256:ceee85d0b05e2b6e178e8aaa1d7e7ee679e5b712ef7a34798f5136321fe6bb3c",
"sha256:e03e5df05f85768af112e287cd89eecfce8a8ca2d6db3531402f7f0b0704d749"
],
"index": "pypi",
"version": "==2.6.2"
},
"pytz": {
"hashes": [
"sha256:07edfc3d4d2705a20a6e99d97f0c4b61c800b8232dc1c04d87e8554f130148dd",
"sha256:3a47ff71597f821cd84a162e71593004286e5be07a340fd462f0d33a760782b5",
"sha256:410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0",
"sha256:5bd55c744e6feaa4d599a6cbd8228b4f8f9ba96de2c38d56f08e534b3c9edf0d",
"sha256:61242a9abc626379574a166dc0e96a66cd7c3b27fc10868003fa210be4bff1c9",
"sha256:887ab5e5b32e4d0c86efddd3d055c1f363cbaa583beb8da5e22d2fa2f64d51ef",
"sha256:ba18e6a243b3625513d85239b3e49055a2f0318466e0b8a92b8fb8ca7ccdf55f",
"sha256:ed6509d9af298b7995d69a440e2822288f2eca1681b8cce37673dbb10091e5fe",
"sha256:f93ddcdd6342f94cea379c73cddb5724e0d6d0a1c91c9bdef364dc0368ba4fda"
],
"index": "pypi",
"version": "==2018.3"
},
"whitenoise": {
"hashes": [
"sha256:51d48bd426d3cf64c1ec5082d1f0d5437649d8ae59114a495e7406faae4fcbd2",
"sha256:a875382e670bdd5ab642b26d930463af4509a6de63b52402c23a7216dc382a99"
],
"index": "pypi",
"version": "==3.2.1"
}
},
"develop": {}
}