Skip to content

Commit

Permalink
Running docker-compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
kayes-islam-veve committed Jun 13, 2021
1 parent 12b7cd0 commit 6b225dd
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions WebApi/WebApi/Startup.cs → Api/WebApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ public void ConfigureServices(IServiceCollection services)
x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(x =>
{
x.MetadataAddress = "http://localhost:8080/auth/realms/AuthDemoRealm/.well-known/openid-configuration";
x.MetadataAddress = "http://keycloak:8080/auth/realms/AuthDemoRealm/.well-known/openid-configuration";
x.RequireHttpsMetadata = false; // only for dev
x.SaveToken = true;
x.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
//ValidIssuer = "",
// NOTE: Usually you don't need to set the issuer since the middleware will extract it
// from the .well-known endpoint provided above. but since I am using the container name in
// the above URL which is not what is published issueer by the well-known, I'm setting it here.
ValidIssuer = "http://localhost:8080/auth/realms/AuthDemoRealm",

ValidAudience = "auth-demo-web-api",
ValidateAudience = true,
ValidateLifetime = true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions Spa/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.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
LICENSE
README.md
13 changes: 13 additions & 0 deletions Spa/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM node:lts-alpine as publish
RUN npm install -g angular-http-server
WORKDIR /Spa
COPY --from=build /app/dist/Spa ./
EXPOSE 4200
ENTRYPOINT angular-http-server -p 4200
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ services:
- ./Keycloak/Volumes/deployments:/opt/jboss/keycloak/standalone/deployments
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_PASSWORD: admin
api:
build:
context: ./Api
ports:
- "5000:80"
spa:
build:
context: ./Spa
ports:
- "4200:4200"

0 comments on commit 6b225dd

Please sign in to comment.