Reorganise a little to move the server into it's own directory

This commit is contained in:
Marc Di Luzio 2020-06-05 17:15:25 +01:00
parent aa2ecace89
commit 5a2d35aca8
5 changed files with 17 additions and 3 deletions

View file

@ -5,7 +5,7 @@ WORKDIR /app
COPY . . COPY . .
RUN go mod download RUN go mod download
RUN go build -o rove-server -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" . RUN go build -o rove-server -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" cmd/rove-server/main.go
CMD [ "./rove-server" ] CMD [ "./rove-server" ]

View file

@ -5,7 +5,7 @@ volumes:
services: services:
rove-server: rove-server:
build: . image: rove-server:latest
ports: ports:
- "80:80" - "80:80"
command: ./rove-server --port 80 --data=/mnt/rove-server command: ./rove-server --port 80 --data=/mnt/rove-server

11
script/build.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"
cd ..
set -x
# Generate a version string
export VERSION=$(git describe --always --long --dirty --tags)
# Build and tag as latest and version
docker build -t "rove-server:latest" -t "rove-server:${VERSION}" -f "cmd/rove-server/Dockerfile" .

View file

@ -4,8 +4,11 @@ cd "$(dirname "$0")"
cd .. cd ..
set -x set -x
# Build the image
bash script/build.sh
# Build and start the service # Build and start the service
docker-compose up --build --detach docker-compose up --detach
# Run tests, including integration tests # Run tests, including integration tests
go mod download go mod download