Skip to content
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

Feature/create UI docker container #1042

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,13 @@ services:
command: -r us -j --no-stats --no-docker-events --skipByName '.*jhipster-registry.*'
volumes:
- /var/run/docker.sock:/var/run/docker.sock

ui:
restart: unless-stopped
image: ${DOCKER_REG}/ui:${TAG:-1}
environment:
- 'SPRING_PROFILES_ACTIVE=prod'
volumes:
- ${LOG_VOLUME:-/var/tmp/}:/logs
ports:
- 4200:4200
33 changes: 33 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:20.7.0-bullseye-slim

# Create app directory
WORKDIR /app

# Install some useful utils for debug/test
RUN \
apt-get update && \
apt -y install procps iproute2 net-tools curl iputils-ping vim && \
rm -rf /var/lib/apt/lists/*

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

COPY container-files/* /var/tmp/

RUN \
chmod +x /var/tmp/* && \
npm install

# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .

RUN npm run build

EXPOSE 4200

ENTRYPOINT /var/tmp/entrypoint.sh
4 changes: 4 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This project was generated with [Angular CLI](https://github.com/angular/angular

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

Run `npm run start` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

Run `npm run start_ssl` for a dev server using https. Navigate to `https://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Expand Down
4 changes: 4 additions & 0 deletions ui/container-files/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# The NPM "start" command/script is defined in the package.json file in the "scripts" dict
npm start
7 changes: 4 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"start": "ng serve --disable-host-check --host 0.0.0.0",
"start_ssl": "ng serve --disable-host-check --host 0.0.0.0 --ssl",
"build": "ng build --base-href ./",
"watch": "ng build --base-href ./ --watch --configuration development",
"test": "ng test"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Gateway</title>
<base href="/">
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
Expand Down
Loading