Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker improovements #47

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ sudo: required
services:
- docker

matrix:
fast_finish: true
include:
- name: "python-3.8"
env: BASE_IMAGE=python:3.8-alpine
- name: "python-3.7"
env: BASE_IMAGE=python:3.7-alpine
- name: "python-3.6"
env: BASE_IMAGE=python:3.6-alpine
- name: "python-3.5"
env: BASE_IMAGE=python:3.5-alpine
- name: "python-2.7"
env: BASE_IMAGE=python:2.7-alpine
allow_failures:
- env: BASE_IMAGE=python:2.7-alpine

before_install:
- docker build -t ritsi/mapa-tasas .
- docker build -t ritsi/mapa-tasas --build-arg BASE_IMAGE=$BASE_IMAGE .

script:
- docker run -it -p 8000:8000 ritsi/mapa-tasas python3 manage.py test
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#FROM mhart/alpine-node
FROM python:3.6-alpine
ARG BASE_IMAGE=python:3.6-alpine
FROM $BASE_IMAGE

ENV HOME /root
ENV SECRET_KEY no-secret-key #Set a secure Django secret key for production!
ENV LIBRARY_PATH=/lib:/usr/lib

WORKDIR $HOME

RUN apk add --update \
RUN apk add --no-cache --update \
mariadb-connector-c-dev \
build-base \
mariadb-dev \
Expand All @@ -16,16 +17,10 @@ RUN apk add --update \
gettext \
jpeg-dev zlib-dev \
&& npm install -g bower topojson ogr2ogr \
&& pip3 install --upgrade pip \
&& rm /var/cache/apk/*
&& pip3 install --upgrade pip

COPY requirements.txt $HOME/
COPY bower.json .bowerrc requirements.txt $HOME/
RUN pip3 install -r requirements.txt
RUN pip3 install mysqlclient
RUN pip3 install whitenoise
RUN pip3 install dj-static

COPY bower.json .bowerrc $HOME/
RUN bower install --allow-root

## COPY PROJECT
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ coverage==4.5.1
django-nose==1.4.6
nose==1.3.7
django-cookie-law>=0.3.0
mysqlclient==1.4.4
whitenoise==4.1.4
dj-static==0.0.6