This commit is contained in:
Jeffrey Duroyon
2019-04-04 14:29:48 +02:00
committed by Jeffrey Duroyon
parent 0df6d64c35
commit 33db360b03
38 changed files with 1476 additions and 1 deletions

17
containers/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
# build stage
ARG SOURCES_IMAGE
FROM $SOURCES_IMAGE as builder
RUN make local-build
# final stage
FROM alpine:3.7
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY --from=builder /go/bin/MamContract .
EXPOSE 8080
ENTRYPOINT ["/app/MamContract"]
CMD ["serve", "--logformat", "json", "--loglevel", "debug"]

View File

@@ -0,0 +1,17 @@
FROM golang:1.11.2-alpine3.8
# Remove the cache to avoid warning message during `apk info`
RUN rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
RUN apk update
# GO and PATH env variables already set in golang image
# to reduce download time
RUN apk --no-cache add -U make git musl-dev gcc
RUN wget https://raw.githubusercontent.com/golang/dep/master/install.sh && sh install.sh
WORKDIR $GOPATH/src/github.com/kratisto/MamContract
ADD . .
RUN make ensure-vendor

View File

@@ -0,0 +1,37 @@
version: "2.1"
services:
database:
image: postgres:10-alpine
ports:
- "5432"
environment:
- POSTGRES_PASSWORD=password
healthcheck:
test: ["CMD-SHELL", "psql -U postgres -c 'SELECT 1;'"]
interval: 10s
timeout: 30s
retries: 3
liquibase:
image: kilna/liquibase-mysql
depends_on:
database:
condition: service_healthy
links:
- database
environment:
- LIQUIBASE_DATABASE=workScheduler
- LIQUIBASE_HOST=database
- LIQUIBASE_USERNAME=postgres
- LIQUIBASE_PASSWORD=password
- LIQUIBASE_CHANGELOG=/changelogs/changelog-master.xml
- LIQUIBASE_CLASSPATH=/changelogs/postgresql-42.2.5.jar
- LIQUIBASE_DRIVER=org.postgresql.Driver
- LIQUIBASE_URL=jdbc:postgresql://database:5432/workScheduler
volumes:
- $PWD/liquibase/changelogs/:/workspace
command:
- liquibase
- --defaultsFile=/workspace/liquibase.properties
- update