forked from mageddo/dns-proxy-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
58 lines (52 loc) · 1.75 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
version: '2'
services:
# Base Image to build project
gocompiler-docker-dns-proxy:
image: golang:1.9
container_name: docker-dns-gocompiler
working_dir: /app/src/github.com/mageddo/dns-proxy-server
volumes:
- $PWD:/app/src/github.com/mageddo/dns-proxy-server
- $PWD/builder:/bin/builder
- /var/run/docker.sock:/var/run/docker.sock
command: tail -f /dev/null
environment:
- TERM=xterm
- GOPATH=/app
- MG_WORK_DIR=/app/src/github.com/mageddo/dns-proxy-server
hostname: dns-proxy-server.dev
network_mode: bridge
# Run from docker image
prod-docker-dns-prod-server:
container_name: dns-proxy-server
image: defreitas/dns-proxy-server:2.4.1
hostname: dns.mageddo
volumes:
- /opt/dns-proxy-server/conf:/app/conf
- /var/run/docker.sock:/var/run/docker.sock
- /etc/resolv.conf:/etc/resolv.conf
ports:
- 5380:5380
network_mode: bridge
# Build project and generate docker image
prod-build-docker-dns-proy-server:
build:
context: .
dockerfile: Dockerfile
container_name: docker-dns-server-docker-compiler
image: defreitas/dns-proxy-server:2.4.1
# Build the project and generate binary at build folder
prod-build-dns-proxy-server:
extends: gocompiler-docker-dns-proxy
container_name: docker-dns-server-compiler
command: bash -c "builder build"
# build the project and make the github release
prod-ci-deploy:
container_name: prod-ci-deploy
extends: gocompiler-docker-dns-proxy
command: bash -c "builder deploy-ci"
environment:
- CURRENT_BRANCH=$TRAVIS_BRANCH # current branch name
- REPO_TOKEN=$REPO_TOKEN # github token to deploy the binary
volumes:
- $HOME/.gitconfig:/root/.gitconfig