diff --git a/.env-travis b/.env-test similarity index 97% rename from .env-travis rename to .env-test index a7256bab8..690838ad9 100644 --- a/.env-travis +++ b/.env-test @@ -19,3 +19,4 @@ DOMAIN=localhost ES_URLS=elasticsearch:9200 SITE_URL=http://localhost:8000 SECRET_KEY=secret +REUSE_STATIC=1 diff --git a/docker-compose.yml b/docker-compose.yml index 3911a820b..ae1e7a93b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,14 +4,12 @@ services: build: context: . cache_from: - - mozmeao/kitsune:latest - image: kitsune:latest + - mozmeao/kitsune:base-latest + - kitsune:latest + dockerfile: docker/dockerfiles/base + image: kitsune:base-latest command: ./manage.py runserver 0.0.0.0:8000 user: ${UID:-kitsune} - volumes: - - ./:/app - - node_modules:/app/node_modules - - bower_components:/app/bower_components depends_on: - mariadb - elasticsearch @@ -40,5 +38,3 @@ services: volumes: mysqlvolume: - node_modules: - bower_components: diff --git a/docker/composefiles/docker-compose.dev.yml b/docker/composefiles/docker-compose.dev.yml new file mode 100644 index 000000000..284fbfdcd --- /dev/null +++ b/docker/composefiles/docker-compose.dev.yml @@ -0,0 +1,13 @@ +version: '3.4' +services: + web: + command: ./manage.py runserver 0.0.0.0:8000 + volumes: + - ./:/app + + mariadb: + volumes: + - mysqlvolume:/var/lib/mysql + +volumes: + mysqlvolume: diff --git a/docker/composefiles/docker-compose.test.yml b/docker/composefiles/docker-compose.test.yml new file mode 100644 index 000000000..93a88d4b5 --- /dev/null +++ b/docker/composefiles/docker-compose.test.yml @@ -0,0 +1,6 @@ +version: '3.4' +services: + web: + command: ./manage.py test --noinput --nologcapture -a '!search_tests' --with-nicedots + user: kitsune + env_file: .env-test diff --git a/docker/dockerfiles/base b/docker/dockerfiles/base index fa5d272a2..c62c3b242 100644 --- a/docker/dockerfiles/base +++ b/docker/dockerfiles/base @@ -9,7 +9,7 @@ ENV PYTHONUNBUFFERED=1 RUN groupadd --gid 1000 kitsune && useradd -g kitsune --uid 1000 --shell /usr/sbin/nologin kitsune # Node is used in the staticfiles dockerfile but since this base image -# is used for development get it installed here. +# is used for development get it installed here too. RUN apt-get update && apt-get install apt-transport-https && \ echo "deb https://deb.nodesource.com/node_0.10 jessie main" >> /etc/apt/sources.list && \ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \