-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker-compose and dockerfile for api gateway for web
- Loading branch information
1 parent
e379634
commit 5aee5cb
Showing
4 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN go build -o /build | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder /build /app/build | ||
|
||
EXPOSE 8080 | ||
|
||
CMD [ "/app/build" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3.9' | ||
|
||
services: | ||
api_gateway_web: | ||
container_name: api_gateway_web | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
version: '3.1' | ||
|
||
services: | ||
|
||
### User Management API | ||
mongo_db_users: | ||
image: mongo:7.0.6 | ||
volumes: | ||
- mongo_data_users:/data/mongo | ||
restart: unless-stopped | ||
networks: | ||
- native | ||
|
||
user_management_api: | ||
container_name: users_management_api | ||
build: | ||
context: UserManagementAPI | ||
dockerfile: Dockerfile | ||
restart: always | ||
environment: | ||
MONGO_DB_URI: mongodb://mongo_db_users:27017/users_db | ||
expose: | ||
- 8080 | ||
depends_on: | ||
- mongo_db_users | ||
networks: | ||
- native | ||
|
||
### Restaurant Management API | ||
mongo_db_restaurants: | ||
image: mongo:7.0.6 | ||
volumes: | ||
- mongo_data_restaurants:/data/mongo | ||
restart: unless-stopped | ||
networks: | ||
- native | ||
|
||
restaurant_management_api: | ||
container_name: restaurant_management_api | ||
build: | ||
context: RestaurantManagementAPI | ||
dockerfile: ./src/main/docker/Dockerfile.jvm | ||
restart: always | ||
environment: | ||
MONGO_DB_URI: mongodb://mongo_db_restaurants:27017/restaurant_db | ||
expose: | ||
- 8080 | ||
depends_on: | ||
- mongo_db_restaurants | ||
networks: | ||
- native | ||
|
||
### Order Processing API | ||
mongo_db_orders: | ||
image: mongo:7.0.6 | ||
volumes: | ||
- mongo_data_orders:/data/mongo | ||
restart: unless-stopped | ||
networks: | ||
- native | ||
|
||
order_processing_api: | ||
container_name: order_processing_grpc_api | ||
build: | ||
context: OrderProcessingAPI | ||
dockerfile: ./src/main/docker/Dockerfile.jvm | ||
restart: always | ||
environment: | ||
MONGO_DB_URI: mongodb://mongo_db_orders:27017/orders_db | ||
RABBITMQ_HOST: rabbitmq_container | ||
expose: | ||
- 8080 | ||
- 9000 | ||
depends_on: | ||
- mongo_db_orders | ||
networks: | ||
- native | ||
|
||
web_api_gateway: | ||
build: | ||
context: API_GatewayWEB | ||
dockerfile: Dockerfile | ||
restart: always | ||
environment: | ||
USERS_API: http://users_management_api:8080/api/v1 | ||
RESTAURANTS_API: http://restaurant_management_api:8080 | ||
ORDERS_GRPC_API: order_processing_grpc_api:9000 | ||
expose: | ||
- 8080 | ||
ports: | ||
- "8080:8080" | ||
networks: | ||
- native | ||
|
||
networks: | ||
native: | ||
name: native-network | ||
driver: bridge | ||
|
||
volumes: | ||
mongo_data_users: | ||
mongo_data_restaurants: | ||
mongo_data_orders: |