forked from mehdihadeli/food-delivery-microservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.services.dev.yaml
103 lines (98 loc) · 8.6 KB
/
docker-compose.services.dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# https://docs.docker.com/compose/reference/#use--f-to-specify-name-and-path-of-one-or-more-compose-files
# https://docs.docker.com/compose/extends/
# Overrid 'docker-compose.services.yaml' configs here for development mode
# To build and debug the app on dev machine --> docker-compose -f docker-compose.services.yaml -f docker-compose.services.dev.yml build
# To start and debug the app on dev machine --> docker-compose -f docker-compose.services.yaml -f docker-compose.services.dev.yaml up -d
version: "3.8"
services:
gateway:
# https://nickjanetakis.com/blog/docker-tip-57-using-build-and-image-in-the-same-docker-compose-servicemage
image: gateway:dev
build:
context: ../../
dockerfile: src/ApiGateway/dev.Dockerfile
container_name: gateway-dev
# https://www.richard-banks.org/2018/07/debugging-core-in-docker.html
# https://copyprogramming.com/howto/docker-compose-says-pwd-variable-not-set-windows
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes#installing-vsdbg-on-the-server
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-from-the-shell
# https://github.com/docker/compose/issues/5089#issuecomment-321822300
# this mappings increase the size of docker image so we use it just in dev, debug mode, in prod its better dockerfile restore just nugets it needs for decresing image size
# here we use full build image for debugging but we change dcoker file `entrypoint` durring `docker run` for for preventing launch app in docker container but with using new entrypoint our stage will run on app working directory and then in our launch.json we launch our app inner container with connecting to `identity-debug` container with `pipeTransport` and `vsdbg` (internaly use dcoker exec and run vsdb on container) and then with using coreclr type and prgram to run, it will run this program with `dotnet run` by coreclr and passed `args`
# https://docs.docker.com/storage/volumes/#use-a-read-only-volume
volumes:
- ~/vsdbg:/vsdbg:ro
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/.nuget/packages:/home/appuser/.nuget/packages:ro
catalogs:
# https://nickjanetakis.com/blog/docker-tip-57-using-build-and-image-in-the-same-docker-compose-service
image: catalogs:dev
build:
# the .dockerignore needs to be in the root of your build context. The build context is the directory you pass at the end of the build command, often a . or the current directory
# we can use a .dockerignore file to exclude some files or directories from build context
# https://docs.docker.com/build/building/context/
# https://docs.docker.com/engine/reference/commandline/build/
# https://www.howtogeek.com/devops/understanding-the-docker-build-context-why-you-should-use-dockerignore/
context: ../../
dockerfile: src/Services/Catalogs/dev.Dockerfile
container_name: catalogs-dev
# https://www.richard-banks.org/2018/07/debugging-core-in-docker.html
# https://copyprogramming.com/howto/docker-compose-says-pwd-variable-not-set-windows
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes#installing-vsdbg-on-the-server
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-from-the-shell
# https://github.com/docker/compose/issues/5089#issuecomment-321822300
# this mappings increase the size of docker image so we use it just in dev, debug mode, in prod its better dockerfile restore just nugets it needs for decresing image size
# here we use full build image for debugging but we change dcoker file `entrypoint` durring `docker run` for for preventing launch app in docker container but with using new entrypoint our stage will run on app working directory and then in our launch.json we launch our app inner container with connecting to `identity-debug` container with `pipeTransport` and `vsdbg` (internaly use dcoker exec and run vsdb on container) and then with using coreclr type and prgram to run, it will run this program with `dotnet run` by coreclr and passed `args`
# https://docs.docker.com/storage/volumes/#use-a-read-only-volume
volumes:
- ~/vsdbg:/vsdbg:ro
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/.nuget/packages:/home/appuser/.nuget/packages:ro
identity:
# https://nickjanetakis.com/blog/docker-tip-57-using-build-and-image-in-the-same-docker-compose-service
image: identity:dev
build:
# the .dockerignore needs to be in the root of your build context. The build context is the directory you pass at the end of the build command, often a . or the current directory
# we can use a .dockerignore file to exclude some files or directories from build context
# https://docs.docker.com/build/building/context/
# https://docs.docker.com/engine/reference/commandline/build/
# https://www.howtogeek.com/devops/understanding-the-docker-build-context-why-you-should-use-dockerignore/
context: ../../
dockerfile: src/Services/Identity/dev.Dockerfile
container_name: identity-dev
# https://www.richard-banks.org/2018/07/debugging-core-in-docker.html
# https://copyprogramming.com/howto/docker-compose-says-pwd-variable-not-set-windows
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes#installing-vsdbg-on-the-server
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-from-the-shell
# https://github.com/docker/compose/issues/5089#issuecomment-321822300
# this mappings increase the size of docker image so we use it just in dev, debug mode, in prod its better dockerfile restore just nugets it needs for decresing image size
# here we use full build image for debugging but we change dcoker file `entrypoint` durring `docker run` for for preventing launch app in docker container but with using new entrypoint our stage will run on app working directory and then in our launch.json we launch our app inner container with connecting to `identity-debug` container with `pipeTransport` and `vsdbg` (internaly use dcoker exec and run vsdb on container) and then with using coreclr type and prgram to run, it will run this program with `dotnet run` by coreclr and passed `args`
# https://docs.docker.com/storage/volumes/#use-a-read-only-volume
volumes:
- ~/vsdbg:/vsdbg:ro
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/.nuget/packages:/home/appuser/.nuget/packages:ro
customers:
# https://nickjanetakis.com/blog/docker-tip-57-using-build-and-image-in-the-same-docker-compose-service
image: customers:dev
build:
# the .dockerignore needs to be in the root of your build context. The build context is the directory you pass at the end of the build command, often a . or the current directory
# we can use a .dockerignore file to exclude some files or directories from build context
# https://docs.docker.com/build/building/context/
# https://docs.docker.com/engine/reference/commandline/build/
# https://www.howtogeek.com/devops/understanding-the-docker-build-context-why-you-should-use-dockerignore/
context: ../../
dockerfile: src/Services/Customers/dev.Dockerfile
container_name: customers-dev
# https://www.richard-banks.org/2018/07/debugging-core-in-docker.html
# https://copyprogramming.com/howto/docker-compose-says-pwd-variable-not-set-windows
# https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes#installing-vsdbg-on-the-server
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-from-the-shell
# https://github.com/docker/compose/issues/5089#issuecomment-321822300
# this mappings increase the size of docker image so we use it just in dev, debug mode, in prod its better dockerfile restore just nugets it needs for decresing image size
# here we use full build image for debugging but we change dcoker file `entrypoint` durring `docker run` for for preventing launch app in docker container but with using new entrypoint our stage will run on app working directory and then in our launch.json we launch our app inner container with connecting to `identity-debug` container with `pipeTransport` and `vsdbg` (internaly use dcoker exec and run vsdb on container) and then with using coreclr type and prgram to run, it will run this program with `dotnet run` by coreclr and passed `args`
# https://docs.docker.com/storage/volumes/#use-a-read-only-volume
volumes:
- ~/vsdbg:/vsdbg:ro
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/.nuget/packages:/home/appuser/.nuget/packages:ro