feat Preparar contenedor Docker

parent 8ce9b4c3
.git
.gitignore
Dockerfile
staticfiles
......@@ -51,6 +51,8 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
.scannerwork
sonar-project.properties
# Translations
*.mo
......@@ -61,6 +63,7 @@ coverage.xml
local_settings.py
db.sqlite3
settings.py
staticfiles
# Flask stuff:
instance/
......
# Pull base image
FROM python:3.7-slim
LABEL maintainer="Enrique Matías Sánchez <quique@unizar.es>"
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install packages needed to run your application (not build deps):
# libmariadbclient-client -- for running database commands
# libpcre3 -- for uWSGI internal routing support
# xmlsec1 -- required for SAML auth
# mime-support -- for mime types when serving static files
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmariadbclient18 \
libpcre3 \
libxmlsec1-openssl \
mime-support
# Copy the requirements file to the container image
COPY requirements.txt ./
# - Install the build dependencies needed
# - Run `pip install` to install the requirements
# - Then remove unneeded build deps (C compiler, etc)
# All in a single step, so that Docker cache it as a single layer.
RUN set -ex \
&& BUILD_DEPS=" \
gcc \
libmariadbclient-dev \
libpcre3-dev \
libxmlsec1-dev" \
&& apt-get install -y --no-install-recommends $BUILD_DEPS \
&& pip install --no-cache-dir -r requirements.txt \
# && pip install gunicorn \
&& pip install uwsgi \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy your application code to the container image
# (make sure you create a .dockerignore file if any large files or directories should be excluded)
WORKDIR /code
COPY . /code
# The WSGI server will listen on this port
EXPOSE 8000
# Add any static environment variables needed by Django or your settings file here:
# ENV DJANGO_SETTINGS_MODULE=my_project.settings.deploy
# Call collectstatic
RUN python3 manage.py collectstatic --noinput
## GUNICORN
# CMD exec gunicorn manhattan_project.wsgi:application --bind 0.0.0.0:8000 --workers 3
## uWSGI
# Tell uWSGI where to find your wsgi file:
ENV UWSGI_WSGI_FILE=manhattan_project/wsgi.py
# Base uWSGI configuration (you shouldn't need to change these):
ENV UWSGI_HTTP=:8000 UWSGI_MASTER=1 UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_UID=1000 UWSGI_GID=2000 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy
# Number of uWSGI workers and threads per worker (customize as needed):
ENV UWSGI_WORKERS=2 UWSGI_THREADS=4
# uWSGI static file serving configuration (customize, or comment out if using Whitenoise or S3):
# ENV UWSGI_STATIC_MAP="/static/=/code/staticfiles/" UWSGI_STATIC_EXPIRES_URI="/static/.*\.[a-f0-9]{12,}\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf|otf|svg|scss|map|txt) 315360000"
# Deny invalid hosts before they get to Django (uncomment and change to your hostname(s)):
# ENV UWSGI_ROUTE_HOST="^(?!localhost:8000$) break:400"
# Uncomment after creating your docker-entrypoint.sh
ENTRYPOINT ["/code/docker-entrypoint.sh"]
# Start uWSGI
CMD ["uwsgi", "--show-config"]
......@@ -7,7 +7,7 @@ verify_ssl = true
pylint = "*"
[packages]
django = "==2.2"
django = "==2.2.1"
mysqlclient = "*"
social-auth-app-django = "*"
social-auth-core = {extras = ["saml"],version = "*"}
......@@ -16,6 +16,7 @@ cx-oracle = "*"
django-crispy-forms = "==1.7.2"
django-summernote = "*"
django-templated-email = "*"
whitenoise = "*"
[requires]
python_version = "3.7"
{
"_meta": {
"hash": {
"sha256": "eaf8065cde8a729bf0365639438b57754a7309ebc30790e7bec4347d53905170"
"sha256": "888efd2bcd3af735982120a9303ab167129eb5e4a2654869288a03f83dfa3325"
},
"pipfile-spec": 6,
"requires": {
......@@ -60,11 +60,11 @@
},
"django": {
"hashes": [
"sha256:7c3543e4fb070d14e10926189a7fcf42ba919263b7473dceaefce34d54e8a119",
"sha256:a2814bffd1f007805b19194eb0b9a331933b82bd5da1c3ba3d7b7ba16e06dc4b"
"sha256:6fcc3cbd55b16f9a01f37de8bcbe286e0ea22e87096557f1511051780338eaea",
"sha256:bb407d0bb46395ca1241f829f5bd03f7e482f97f7d1936e26e98dacb201ed4ec"
],
"index": "pypi",
"version": "==2.2"
"version": "==2.2.1"
},
"django-crispy-forms": {
"hashes": [
......@@ -195,10 +195,10 @@
},
"requests": {
"hashes": [
"sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e",
"sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b"
"sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4",
"sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"
],
"version": "==2.21.0"
"version": "==2.22.0"
},
"requests-oauthlib": {
"hashes": [
......@@ -244,10 +244,18 @@
},
"urllib3": {
"hashes": [
"sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4",
"sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"
"sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1",
"sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"
],
"version": "==1.24.3"
"version": "==1.25.3"
},
"whitenoise": {
"hashes": [
"sha256:118ab3e5f815d380171b100b05b76de2a07612f422368a201a9ffdeefb2251c1",
"sha256:42133ddd5229eeb6a0c9899496bdbe56c292394bf8666da77deeb27454c0456a"
],
"index": "pypi",
"version": "==4.1.2"
},
"xmlsec": {
"hashes": [
......@@ -266,33 +274,33 @@
},
"isort": {
"hashes": [
"sha256:1349c6f7c2a0f7539f5f2ace51a9a8e4a37086ce4de6f78f5f53fb041d0a3cd5",
"sha256:f09911f6eb114e5592abe635aded8bf3d2c3144ebcfcaf81ee32e7af7b7d1870"
"sha256:c40744b6bc5162bbb39c1257fe298b7a393861d50978b565f3ccd9cb9de0182a",
"sha256:f57abacd059dc3bd666258d1efb0377510a89777fda3e3274e3c01f7c03ae22d"
],
"version": "==4.3.18"
"version": "==4.3.20"
},
"lazy-object-proxy": {
"hashes": [
"sha256:118d53f8819f9457732dd0e418752f2850f395c5405b2e12485f52336e4ad0f5",
"sha256:495c583b363c3eded649e2c00177093f03f856f5c9f95b527420084a9ce17b9d",
"sha256:55fa9eab93482891ce97473e63610efdd9c8fa5c05cca9f60468c412e602e499",
"sha256:642fc0a9b61920669dab66e400f79f1b8b0e8f698dcde85f7e9ae5528dbcaf4a",
"sha256:7003959a170fde9b92936c38562810f94679c80608fb4b007e026b915bef8b27",
"sha256:7e63da94f5a1ddb0d2dcdb5d17ff4d1d33f51f3368bdf0475d5f56c0f3b99592",
"sha256:7fb11d33d99a374e4b0c3fb20128890b9cf784ca7e4b91ecbb191d34618bd9fe",
"sha256:8758715ea005afa293783797498d64f40ab14d1ded208b3e282760cde9512f1d",
"sha256:8995543f47a8b81962e384f12791114af9f4997be7a0db71abc40d2a2dfee961",
"sha256:91c7e1316116fedda36818ce7cd269378fffc4219781536eff441ea1e68e1caf",
"sha256:9b41ec246d31ca6a840dcf67673b2668adc5a095c64310d26d73292588563ea3",
"sha256:a8be3cfd7c3154e8d39276c627c5e7ee55d1f2094597b060ece99620ef9fe86b",
"sha256:afcab74f471652b643900e0862b31892ac5fe5a75e435b786a1825855f4effdf",
"sha256:d49a90c27074f44c8dc147d83e31140523948ee147b3248634c540e053caea58",
"sha256:d6957cadc9c079ef4697564af500d52fba6d14fb2f08d20ce92f52201fb77050",
"sha256:da7f2a6c82a11dc4e05bab73522f0d6dd4f3bbc8378cd4b0769137f342cdb3f0",
"sha256:f03a21f6f6e54778860122a620f70c8b148ec4ee175968782bcaaa94955a46f9",
"sha256:f6c718ffca055852479880debbe717da952fcfd60067a0ddb6fe3b053b1d4de0"
],
"version": "==1.4.0"
"sha256:159a745e61422217881c4de71f9eafd9d703b93af95618635849fe469a283661",
"sha256:23f63c0821cc96a23332e45dfaa83266feff8adc72b9bcaef86c202af765244f",
"sha256:3b11be575475db2e8a6e11215f5aa95b9ec14de658628776e10d96fa0b4dac13",
"sha256:3f447aff8bc61ca8b42b73304f6a44fa0d915487de144652816f950a3f1ab821",
"sha256:4ba73f6089cd9b9478bc0a4fa807b47dbdb8fad1d8f31a0f0a5dbf26a4527a71",
"sha256:4f53eadd9932055eac465bd3ca1bd610e4d7141e1278012bd1f28646aebc1d0e",
"sha256:64483bd7154580158ea90de5b8e5e6fc29a16a9b4db24f10193f0c1ae3f9d1ea",
"sha256:6f72d42b0d04bfee2397aa1862262654b56922c20a9bb66bb76b6f0e5e4f9229",
"sha256:7c7f1ec07b227bdc561299fa2328e85000f90179a2f44ea30579d38e037cb3d4",
"sha256:7c8b1ba1e15c10b13cad4171cfa77f5bb5ec2580abc5a353907780805ebe158e",
"sha256:8559b94b823f85342e10d3d9ca4ba5478168e1ac5658a8a2f18c991ba9c52c20",
"sha256:a262c7dfb046f00e12a2bdd1bafaed2408114a89ac414b0af8755c696eb3fc16",
"sha256:acce4e3267610c4fdb6632b3886fe3f2f7dd641158a843cf6b6a68e4ce81477b",
"sha256:be089bb6b83fac7f29d357b2dc4cf2b8eb8d98fe9d9ff89f9ea6012970a853c7",
"sha256:bfab710d859c779f273cc48fb86af38d6e9210f38287df0069a63e40b45a2f5c",
"sha256:c10d29019927301d524a22ced72706380de7cfc50f767217485a912b4c8bd82a",
"sha256:dd6e2b598849b3d7aee2295ac765a578879830fb8966f70be8cd472e6069932e",
"sha256:e408f1eacc0a68fed0c08da45f31d0ebb38079f043328dce69ff133b95c29dc1"
],
"version": "==1.4.1"
},
"mccabe": {
"hashes": [
......
#!/bin/sh
set -e
if [ "x$DJANGO_MANAGEPY_MIGRATE" = 'xon' ]; then
echo "Apply database migrations"
sleep 1
python manage.py migrate --noinput
fi
exec "$@"
\ No newline at end of file
-i https://pypi.org/simple
certifi==2019.3.9
chardet==3.0.4
cx-oracle==7.1.3
defusedxml==0.5.0 ; python_version >= '3.0'
django-crispy-forms==1.7.2
django-render-block==0.6
django-summernote==0.8.11.4
django-templated-email==2.3.0
django==2.2.1
idna==2.8
isodate==0.6.0
lxml==4.3.3
mysqlclient==1.4.2.post1
oauthlib==3.0.1
pkgconfig==1.5.1
pyjwt==1.7.1
python3-openid==3.1.0 ; python_version >= '3.0'
python3-saml==1.6.0
pytz==2019.1
requests-oauthlib==1.2.0
requests==2.22.0
six==1.12.0
social-auth-app-django==3.1.0
social-auth-core[saml]==3.1.0
sqlparse==0.3.0
urllib3==1.25.3
whitenoise==4.1.2
xmlsec==1.3.3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment