Updates to docker-compose and machine create make command; using config overrides

This commit is contained in:
mitchell 2019-05-29 08:02:04 -07:00
parent c5ae0b4ddc
commit db246df3d6
3 changed files with 22 additions and 14 deletions

View File

@ -1,4 +1,4 @@
.PHONY: all build clean format test docker-build
.PHONY: all build clean format test
build: clean format
env CGO_ENABLED=0 go build -o ./bin/server ./cmd/server
@ -11,32 +11,31 @@ clean:
docker:
docker-compose build
local:
docker-compose up -d
up:
docker-compose up
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
upd:
docker-compose up -d
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
down:
docker-compose down
machine-create-google:
docker-machine create --driver google \
--google-address m-selfpass \
--google-address selfpass \
--google-project selfpass-241808 \
--google-machine-type n1-standard-1 \
--google-machine-type f1-micro \
--google-machine-image https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-9-stretch-v20190514 \
--google-username selfpass \
--google-zone us-west1-c \
selfpass01
machine-rm:
docker-machine rm selfpass01
machine-ssh:
docker-machine ssh selfpass01
machine-env:
docker-machine env selfpass01
format:
gofmt -w -s -l .

8
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,8 @@
version: "3.7"
services:
redis:
volumes:
- "/home/selfpass/data:/data"
server:
entrypoint:
- server

View File

@ -2,15 +2,16 @@ version: "3.7"
services:
redis:
image: "redis:5.0.5"
restart: on-failure
volumes:
- "./data:/data"
server:
build: .
restart: always
ports:
- "8080:8080"
restart: on-failure
entrypoint:
- server
- -v
ports:
- "8080:8080"
depends_on:
- redis