Mainflux.mainflux/docker/Dockerfile

18 lines
461 B
Docker
Raw Normal View History

2018-05-11 05:53:25 +08:00
FROM golang:1.10-alpine AS builder
Use PostgreSQL as primary persistence solution (#175) * Use normalizer as stream source Renamed 'writer' service to 'normalizer' and dropped Cassandra facilities from it. Extracted the common dependencies to 'mainflux' package for easier sharing. Fixed the API docs and unified environment variables. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use docker build arguments to specify build Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove cassandra libraries Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update go-kit version to 0.6.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix manager configuration Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Refactor docker-compose Merged individual compose files and dropped external links. Remove CoAP container since it is not referenced from NginX config at the moment. Update port mapping in compose and nginx.conf. Dropped bin scripts. Updated service documentation. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Drop content-type check Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement users data access layer in PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Bump version to 0.1.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use go-kit logger everywhere (except CoAP) Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Improve factory methods naming Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement clients data access layer on PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Make tests stateless All tests are refactored to use map-based table-driven tests. No cross-tests dependencies is present anymore. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove gitignore Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nginx proxying Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Mark client-user FK explicit Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update API documentation Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update channel model Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add channel PostgreSQL repository tests Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement PostgreSQL channels DAO Replaced update queries with raw SQL. Explicitly defined M2M table due to difficulties of ensuring the referential integrity through GORM. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Expose connection endpoints Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix swagger docs and remove DB logging Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nested query remarks Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add unique indices Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-12 01:06:01 +08:00
ARG SVC_NAME
WORKDIR /go/src/github.com/mainflux/mainflux
COPY . .
Use PostgreSQL as primary persistence solution (#175) * Use normalizer as stream source Renamed 'writer' service to 'normalizer' and dropped Cassandra facilities from it. Extracted the common dependencies to 'mainflux' package for easier sharing. Fixed the API docs and unified environment variables. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use docker build arguments to specify build Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove cassandra libraries Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update go-kit version to 0.6.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix manager configuration Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Refactor docker-compose Merged individual compose files and dropped external links. Remove CoAP container since it is not referenced from NginX config at the moment. Update port mapping in compose and nginx.conf. Dropped bin scripts. Updated service documentation. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Drop content-type check Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement users data access layer in PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Bump version to 0.1.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use go-kit logger everywhere (except CoAP) Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Improve factory methods naming Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement clients data access layer on PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Make tests stateless All tests are refactored to use map-based table-driven tests. No cross-tests dependencies is present anymore. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove gitignore Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nginx proxying Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Mark client-user FK explicit Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update API documentation Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update channel model Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add channel PostgreSQL repository tests Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement PostgreSQL channels DAO Replaced update queries with raw SQL. Explicitly defined M2M table due to difficulties of ensuring the referential integrity through GORM. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Expose connection endpoints Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix swagger docs and remove DB logging Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nested query remarks Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add unique indices Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-12 01:06:01 +08:00
RUN apk update \
&& apk add make protobuf git \
&& go get -u github.com/golang/protobuf/protoc-gen-go \
MF-407 - Values of zero are being omitted (#434) * Fix empty protobuf values Update Normalizer service and .proto files. Reader and Writer services needs to be updated due to message format change. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update HTTP adapter to use gogo protobuf Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Reader services API Update API or Reader services to match Message changes due to switching to gogo/proto. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update InfluxDB services Update InfluxDB Reader and Writer services to match new Message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update MongoDB services Update MongoDB Reader and Writer services to match new message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra services Update Cassandra Reader and Writer service to match new Message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB Reader test Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Makefile and docs accordingly Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix possible data race in InfluxDB writer Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update InfluxDB Writer tests Raise test coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB reader Fix wrong ValueSum readings. Upadete tests and raise coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update MongoDB services tests Raise test coverage for MongoDB Reader and Writer services. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Readers API tests Raise test coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Raise test coverage Update Cassandra Reader and Writer services tests. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use gogo/protobuf in CoAP adapter Add gogo/protobuf to Gopkg.toml and update dependencies. Update Dockerfile to run `make proto`. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra Reader tests Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Improve code style and comments to improve readability. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Rename Sum to SumValue Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Rename Values to Value Since message contains only single value (or possibly no value at all), `Values` name could be misleading. Rename simple double value from `Value` to `FloatValue` accordingly. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB Reader logging Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Replace exclusive if statements with switch-case Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra services tests Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-06 02:18:51 +08:00
&& go get github.com/gogo/protobuf/protoc-gen-gofast \
2018-05-11 05:53:25 +08:00
&& go get -u google.golang.org/grpc \
MF-407 - Values of zero are being omitted (#434) * Fix empty protobuf values Update Normalizer service and .proto files. Reader and Writer services needs to be updated due to message format change. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update HTTP adapter to use gogo protobuf Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Reader services API Update API or Reader services to match Message changes due to switching to gogo/proto. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update InfluxDB services Update InfluxDB Reader and Writer services to match new Message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update MongoDB services Update MongoDB Reader and Writer services to match new message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra services Update Cassandra Reader and Writer service to match new Message format. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB Reader test Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Makefile and docs accordingly Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix possible data race in InfluxDB writer Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update InfluxDB Writer tests Raise test coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB reader Fix wrong ValueSum readings. Upadete tests and raise coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update MongoDB services tests Raise test coverage for MongoDB Reader and Writer services. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Readers API tests Raise test coverage. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Raise test coverage Update Cassandra Reader and Writer services tests. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use gogo/protobuf in CoAP adapter Add gogo/protobuf to Gopkg.toml and update dependencies. Update Dockerfile to run `make proto`. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra Reader tests Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Improve code style and comments to improve readability. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Rename Sum to SumValue Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Rename Values to Value Since message contains only single value (or possibly no value at all), `Values` name could be misleading. Rename simple double value from `Value` to `FloatValue` accordingly. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix InfluxDB Reader logging Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Replace exclusive if statements with switch-case Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update Cassandra services tests Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-06 02:18:51 +08:00
&& make proto \
&& make $SVC_NAME \
&& mv build/mainflux-$SVC_NAME /exe
Use PostgreSQL as primary persistence solution (#175) * Use normalizer as stream source Renamed 'writer' service to 'normalizer' and dropped Cassandra facilities from it. Extracted the common dependencies to 'mainflux' package for easier sharing. Fixed the API docs and unified environment variables. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use docker build arguments to specify build Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove cassandra libraries Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update go-kit version to 0.6.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix manager configuration Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Refactor docker-compose Merged individual compose files and dropped external links. Remove CoAP container since it is not referenced from NginX config at the moment. Update port mapping in compose and nginx.conf. Dropped bin scripts. Updated service documentation. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Drop content-type check Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement users data access layer in PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Bump version to 0.1.0 Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Use go-kit logger everywhere (except CoAP) Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Improve factory methods naming Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement clients data access layer on PostgreSQL Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Make tests stateless All tests are refactored to use map-based table-driven tests. No cross-tests dependencies is present anymore. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Remove gitignore Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nginx proxying Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Mark client-user FK explicit Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update API documentation Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Update channel model Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add channel PostgreSQL repository tests Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Implement PostgreSQL channels DAO Replaced update queries with raw SQL. Explicitly defined M2M table due to difficulties of ensuring the referential integrity through GORM. Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Expose connection endpoints Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix swagger docs and remove DB logging Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Fix nested query remarks Signed-off-by: Dejan Mijic <dejan@mainflux.com> * Add unique indices Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-12 01:06:01 +08:00
FROM scratch
COPY --from=builder /exe /
ENTRYPOINT ["/exe"]