diff options
author | 2018-08-31 21:04:15 +0000 | |
---|---|---|
committer | 2018-08-31 21:04:15 +0000 | |
commit | 52462b6fc5be74a6150530218ebe1b24e5e899e5 (patch) | |
tree | 8c6e0c238e25225fd55da0f99bb3aedcb9847aae /docker | |
parent | Add a `Dockerfile`. (diff) | |
parent | Always upload cov reports, add pipenv cache. (diff) |
Merge branch 'django+add-gitlab-ci' into 'django'
Django - Add GitLab CI.
See merge request python-discord/projects/site!36
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile.base | 25 | ||||
-rw-r--r-- | docker/base.Dockerfile | 18 | ||||
-rw-r--r-- | docker/ci.Dockerfile | 23 |
3 files changed, 18 insertions, 48 deletions
diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base deleted file mode 100644 index 7119d770..00000000 --- a/docker/Dockerfile.base +++ /dev/null @@ -1,25 +0,0 @@ -FROM python:3.6-alpine3.7 - -RUN apk add --update tini -RUN apk add --update git -RUN apk add --update build-base -RUN apk add --update gcc -RUN apk add --update cmake -RUN apk add --update autoconf -RUN apk add --update automake -RUN apk add --update libtool - -ENV PIPENV_VENV_IN_PROJECT=1 -ENV PIPENV_IGNORE_VIRTUALENVS=1 -ENV PIPENV_NOSPIN=1 -ENV PIPENV_HIDE_EMOJIS=1 - -RUN pip install pipenv - -RUN mkdir -p /site -COPY Pipfile /site -COPY Pipfile.lock /site -WORKDIR /site -ENV PYTHONPATH=/site - -RUN pipenv sync diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile new file mode 100644 index 00000000..c90ee5dc --- /dev/null +++ b/docker/base.Dockerfile @@ -0,0 +1,18 @@ +# Base image used for building the site. +FROM python:3.7-alpine + +RUN apk add python3-dev git libpq postgresql-dev gcc cmake autoconf automake musl-dev +RUN python3 -m pip install pipenv + +ENV PIPENV_HIDE_EMOJIS=1 +ENV PIPENV_IGNORE_VIRTUALENVS=1 +ENV PIPENV_MAX_SUBPROCESS=2 +ENV PIPENV_NOSPIN=1 +ENV PIPENV_VENV_IN_PROJECT=1 + +COPY . /app +WORKDIR /app + +RUN pipenv install --deploy --system + +CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite:wsgi"] diff --git a/docker/ci.Dockerfile b/docker/ci.Dockerfile deleted file mode 100644 index 0153696a..00000000 --- a/docker/ci.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.6-alpine3.7 - -# Install base packages -RUN apk add --update autoconf automake \ - build-base \ - cmake curl \ - docker \ - gcc git \ - libtool \ - nodejs nodejs-npm \ - ruby ruby-dev ruby-irb ruby-rdoc \ - tini - -# Set up env vars -ENV PIPENV_VENV_IN_PROJECT=1 -ENV PIPENV_IGNORE_VIRTUALENVS=1 -ENV PIPENV_NOSPIN=1 -ENV PIPENV_HIDE_EMOJIS=1 - -# Install toolchain -RUN pip install pipenv -RUN gem install scss_lint -RUN npm install -g eslint gulp-cli |