Skip to content

Commit

Permalink
add docker-compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilphillip committed Sep 20, 2020
1 parent 95d3f4b commit a32f7b0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/CodeConfigSample/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md
4 changes: 4 additions & 0 deletions src/CodeConfigSample/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
COMPOSE_PROJECT_NAME=yarpconsul
ASPNETCORE_URLS=http://0.0.0.0:80
ASPNETCORE_ENVIRONMENT=Docker
DOTNET_ENVIRONMENT=Docker
16 changes: 16 additions & 0 deletions src/CodeConfigSample/consul.server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"datacenter": "yarp-dc",
"log_level": "INFO",
"bind_addr": "0.0.0.0",
"client_addr": "0.0.0.0",
"bootstrap": true,
"disable_update_check": true,
"telemetry": {
"prometheus_retention_time": "10s"
},
"ui": true,
"dns_config": {
"enable_truncate": true,
"udp_answer_limit": 100
}
}
36 changes: 36 additions & 0 deletions src/CodeConfigSample/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.8"

services:
##### API #####
yarp:
container_name: yarp_proxy
build:
context: ./CCProxy
dockerfile: Dockerfile
ports:
- "5000:80"
env_file:
- .env

##### proxy #####
itemsapi:
build:
context: ./ItemsApi
dockerfile: Dockerfile
env_file:
- .env

consul:
container_name: consul_service
image: consul:1.8.4
restart: unless-stopped
ports:
- "8500:8500" # HTTP API and UI port
command: consul agent -dev -config-dir /etc/consul.d
volumes:
- ./consul.server.json:/etc/consul.d/consul.server.json

networks:
default:
name: yarp_proxy
driver: bridge

0 comments on commit a32f7b0

Please sign in to comment.