version: '3.4'
services:
  db:
    image: postgres:11-alpine
    environment:
      - POSTGRES_PASSWORD=snippets
      - POSTGRES_USER=snippets
      - POSTGRES_DB=snippets
  web:
    build:
      context: .
      args:
        GIT_SHA: "${CI_COMMIT_SHORT_SHA:-HEAD}"
    image: "mozmeao/snippets:${CI_COMMIT_SHORT_SHA:-latest}"
    ports:
      - "8443:8443"
      - "8000:8000"
    volumes:
      - .:/app
    depends_on:
      - db
    command:
      ./bin/run-dev.sh

  redirector:
    build:
      context: ./redirector
      args:
        GIT_SHA: "${CI_COMMIT_SHORT_SHA:-HEAD}"
    image: "mozmeao/snippets:redirector-${CI_COMMIT_SHORT_SHA:-latest}"
    volumes:
      - ./redirector:/app

  test-web:
    image: "mozmeao/snippets:${CI_COMMIT_SHORT_SHA:-latest}"
    depends_on:
      - db
    env_file:
      - test.env
    command:
      ./manage.py test --parallel

  test-redirector:
    image: "mozmeao/snippets:redirector-${CI_COMMIT_SHORT_SHA:-latest}"
    command:
      pytest test.py

version: '3.4'
services:
  db:
    image: postgres:11-alpine
    environment:
      - POSTGRES_PASSWORD=snippets
      - POSTGRES_USER=snippets
      - POSTGRES_DB=snippets
  web:
    build:
      context: .
      args:
        GIT_SHA: "${CI_COMMIT_SHA:-HEAD}"
    image: "mozmeao/snippets:${CI_COMMIT_SHORT_SHA:-latest}"
    ports:
      - "8443:8443"
      - "8000:8000"
    volumes:
      - .:/app
    depends_on:
      - db
    command:
      ./bin/run-dev.sh

  redirector:
    build:
      context: ./redirector
      args:
        GIT_SHA: "${CI_COMMIT_SHA:-HEAD}"
    image: "mozmeao/snippets:redirector-${CI_COMMIT_SHORT_SHA:-latest}"
    volumes:
      - ./redirector:/app

  test-web:
    image: "mozmeao/snippets:${CI_COMMIT_SHORT_SHA:-latest}"
    depends_on:
      - db
    env_file:
      - test.env
    command:
      ./manage.py test --parallel

  test-redirector:
    image: "mozmeao/snippets:redirector-${CI_COMMIT_SHORT_SHA:-latest}"
    command:
      pytest test.py

Use full git commit sha in image.
Use full git commit sha in image.
