Skip to content

Commit

Permalink
dip cmd for bulding deb-version proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
yamax2 committed Aug 12, 2021
1 parent af023e6 commit 86b5342
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions dip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ interaction:
RAILS_ENV: test
command: go test -v ./...

proxy_build:
service: proxy-build
command: go build -ldflags '-s -w' proxy_service.go

rubocop:
service: app
environment:
Expand All @@ -74,6 +78,7 @@ provision:
- docker pull postgres:${POSTGRES_IMAGE_TAG}-alpine
- docker pull redis:${REDIS_IMAGE_TAG}-alpine
- docker pull golang:${DOCKER_GO_VERSION}-alpine
- docker pull golang:${DOCKER_GO_VERSION}
- ./docker/prepare_env.sh
- docker volume create --name bundler_data
- dip compose up -d db
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.proxy.deb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM golang:1.16.7
ARG DOCKER_GO_VERSION
FROM golang:${DOCKER_GO_VERSION}

RUN apt update && apt install -y libvips-dev

COPY proxy_service /proxy
WORKDIR /proxy
RUN go build -ldflags '-s -w' proxy_service.go
WORKDIR /app
11 changes: 11 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ services:
- VIRTUAL_HOST=photostorage.$DOCKER_TLD
- VIRTUAL_PATH=/proxy/

proxy-build:
build:
context: ../
dockerfile: ./docker/Dockerfile.proxy.deb
args:
DOCKER_GO_VERSION: $DOCKER_GO_VERSION
labels:
com.photo-storage.go.version: $DOCKER_GO_VERSION
volumes:
- ../proxy_service:/app

volumes:
bundler-data:
external:
Expand Down

0 comments on commit 86b5342

Please sign in to comment.