Skip to content

Added docker config. #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .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
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:20.0.0
ENV NODE_ENV=production
WORKDIR /usr/src/app
# COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# RUN npm install -g yarn

COPY . .

ENV YARN_VERSION 4.0.0
RUN yarn policies set-version $YARN_VERSION

RUN corepack enable yarn
RUN yarn install
# COPY . .

RUN yarn build:all

EXPOSE 3000
EXPOSE 4000

RUN chown -R node /usr/src/app
USER node
CMD ["yarn", "start:all"]
20 changes: 20 additions & 0 deletions docker-compose.debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.4'

services:
user-managed-access:
image: css-uma-main
build:
context: .
dockerfile: ./Dockerfile
environment:
NODE_ENV: development
ports:
- 3000:3000
- 4000:4000
- 4444:4444
- 5123:5123
- 8201:8201
- 8202:8202
- 8203:8203
- 9229:9229
command: ["node", "--inspect=0.0.0.0:9229", "index.js"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.4'

services:
user-managed-access:
image: css-uma-main
build:
context: .
dockerfile: ./Dockerfile
environment:
NODE_ENV: production
ports:
- 3000:3000
- 4000:4000
2 changes: 2 additions & 0 deletions dockerize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker image build --pull --file './Dockerfile' --tag 'css-uma-main:latest' --label 'com.microsoft.created-by=visual-studio-code' --network=host ./
3 changes: 2 additions & 1 deletion packages/uma/bin/main.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ import { setLogger } from '../src/util/logging/LoggerUtils';
import { WinstonLogger } from '../src/util/logging/WinstonLogger';

const protocol = 'http';
const host = 'localhost';
// const host = 'localhost'; // This gives problems with docker internal network
const host = '0.0.0.0';
const port = 4000;

const baseUrl = `${protocol}://${host}:${port}/uma`;