Updated 04. Setting eShopOnContainer solution up in a Mac, VS for Mac or with CLI environment (dotnet CLI, Docker CLI and VS Code) (markdown)
parent
5bdfb37e2f
commit
7dce72aff2
@ -268,7 +268,7 @@ You can also try/test the SPA (Single Page Application), which is based on Angul
|
|||||||
|
|
||||||
# Configuring the app for Authentication and access from remote client apps (Remote access through the network)
|
# Configuring the app for Authentication and access from remote client apps (Remote access through the network)
|
||||||
|
|
||||||
If you don't configure these further settings, you should get the following error when trying to login in the MVC or SPA apps.
|
If you don't configure these further settings, you should get the following error when trying to login in the MVC web app.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -276,36 +276,60 @@ That is because the by default IP used to redirect to the Identity service/app u
|
|||||||
That IP is always set up when installing Docker for Windows in a Windows 10 machine. It is also used by Windows Server 2016 when using Windows Containers.
|
That IP is always set up when installing Docker for Windows in a Windows 10 machine. It is also used by Windows Server 2016 when using Windows Containers.
|
||||||
|
|
||||||
eShopOnContainers uses that IP as the "by default choice" so anyone testing the app don't need to configure further settings. However, that IP is not used by "Docker for Mac", so you need to change the config.
|
eShopOnContainers uses that IP as the "by default choice" so anyone testing the app don't need to configure further settings. However, that IP is not used by "Docker for Mac", so you need to change the config.
|
||||||
If you were to access the Docker containers from remote machines or mobile phones, like when using the Xamarin app or the web apps in remote PCs, then you would also need to change that IP and use a real IP from the network adapter, like you always need to do when using a Mac.
|
|
||||||
|
If you were to access the Docker containers from remote machines or mobile phones, like when using the Xamarin app or the web apps in remote PCs, then you would also need to change that IP and use a real IP from the network adapter.
|
||||||
|
|
||||||
## Setting up the docker-compose file environment variables and settings
|
## Setting up the docker-compose file environment variables and settings
|
||||||
|
|
||||||
The Mac has a changing IP address (or none if you have no network access). From 17.06 onwards our recommendation is to connect to the special Mac-only DNS name docker.for.mac.localhost which will resolve to the internal IP address used by the host.
|
As explained [here by Docker](https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds),
|
||||||
|
the Mac has a changing IP address (or none if you have no network access). From June 2017 onwards our recommendation is to connect to the special Mac-only DNS name docker.for.mac.localhost which will resolve to the internal IP address used by the host.
|
||||||
|
|
||||||
Therefore, the following change must be done in docker-compose.override.yml.
|
In the `docker-compose.override.yml` file, replace the IdentityUrl environment variable (or any place where the IP 10.0.75.1 is used) with:
|
||||||
In the WebMVC service section, replace the IdentityUrl environment variable with:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
IdentityUrl=http://docker.for.mac.localhost:5105
|
IdentityUrl=http://docker.for.mac.localhost:5105
|
||||||
```
|
```
|
||||||
The WebMVC service definition should finally be configured as shown bellow:
|
|
||||||
|
The WebMVC service definition at the `docker-compose.override.yml` should finally be configured as shown bellow:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
webmvc:
|
webmvc:
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||||
- CatalogUrl=http://catalog.api
|
- CatalogUrl=http://catalog.api
|
||||||
- OrderingUrl=http://ordering.api
|
- OrderingUrl=http://ordering.api
|
||||||
- BasketUrl=http://basket.api
|
- BasketUrl=http://basket.api
|
||||||
|
- LocationsUrl=http://locations.api
|
||||||
- IdentityUrl=http://docker.for.mac.localhost:5105
|
- IdentityUrl=http://docker.for.mac.localhost:5105
|
||||||
- MarketingUrl=http://marketing.api #Local: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser.
|
- MarketingUrl=http://marketing.api
|
||||||
#Remote: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
|
- CatalogUrlHC=http://catalog.api/hc
|
||||||
|
- OrderingUrlHC=http://ordering.api/hc
|
||||||
|
- IdentityUrlHC=http://identity.api/hc
|
||||||
|
- BasketUrlHC=http://basket.api/hc
|
||||||
|
- MarketingUrlHC=http://marketing.api/hc
|
||||||
|
- PaymentUrlHC=http://payment.api/hc
|
||||||
- UseCustomizationData=True
|
- UseCustomizationData=True
|
||||||
|
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
|
||||||
|
- OrchestratorType=${ORCHESTRATOR_TYPE}
|
||||||
|
- UseLoadTest=${USE_LOADTEST:-False}
|
||||||
ports:
|
ports:
|
||||||
- "5100:80"
|
- "5100:80"
|
||||||
```
|
```
|
||||||
|
If you re-deploy with `docker-compose up`, now the login page should work properly.
|
||||||
|
|
||||||
|
# Configuring the app for external access from remote client apps
|
||||||
|
|
||||||
|
eShopOnContainers use the .env file to set certaing by-default environment variables used by the multiple docker-compose.override you can have.
|
||||||
|
|
||||||
|
Therefore, the following change must be done in the .env file at the root of the eShopOnContainers folder.
|
||||||
|
If you don't see the .env file, run the following command and re-start the Finder:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ defaults write com.apple.finder AppleShowAllFiles TRUE
|
||||||
|
|
||||||
|
$ killall Finder
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Sending feedback and pull requests
|
## Sending feedback and pull requests
|
||||||
|
Loading…
x
Reference in New Issue
Block a user