image: docker

services:
  - docker:dind

stages:
  - deploy

step-deploy-prod:
  stage: deploy
  only:
    - master
  script:
    - sudo apt-get install -y python-pip
    - sudo pip install docker-compose
    - sudo docker image prune -f
    - replace "5000:5000" "5003:5000" -- docker-compose-test.yml
    - replace "domains=" "domains=kurz.gq;kurz.ga;kuerzer.cf;kuerzer.ga;kuerzer.gq;kuerzer.ml;kuerzer.tk" -- docker-compose-test.yml
    - replace "recaptcha_private=" "recaptcha_private=6LecXcEUAAAAANzkVPoy-tt33IpdxfTjTE50iH9-" -- docker-compose-test.yml
    - replace "recaptcha_public=" "recaptcha_public=6LecXcEUAAAAAG_MY70KicRJieG0Azcm7-dPsWgm" -- docker-compose-test.yml
    - sudo docker-compose build -f docker-compose-test.yml --no-cache
    - sudo docker-compose up -f docker-compose-test.yml -d
  environment: master 