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 build: clean format
env CGO_ENABLED=0 go build -o ./bin/server ./cmd/server env CGO_ENABLED=0 go build -o ./bin/server ./cmd/server
@ -11,32 +11,31 @@ clean:
docker: docker:
docker-compose build docker-compose build
local:
docker-compose up -d
up: up:
docker-compose up docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
upd: upd:
docker-compose up -d docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
down: down:
docker-compose down docker-compose down
machine-create-google: machine-create-google:
docker-machine create --driver google \ docker-machine create --driver google \
--google-address m-selfpass \ --google-address selfpass \
--google-project selfpass-241808 \ --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-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 selfpass01
machine-rm: machine-rm:
docker-machine rm selfpass01 docker-machine rm selfpass01
machine-ssh:
docker-machine ssh selfpass01
machine-env:
docker-machine env selfpass01
format: format:
gofmt -w -s -l . 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: services:
redis: redis:
image: "redis:5.0.5" image: "redis:5.0.5"
restart: on-failure
volumes: volumes:
- "./data:/data" - "./data:/data"
server: server:
build: . build: .
restart: always restart: on-failure
ports:
- "8080:8080"
entrypoint: entrypoint:
- server - server
- -v - -v
ports:
- "8080:8080"
depends_on: depends_on:
- redis - redis