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

Support docker #4673

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM debian:bookworm as build
WORKDIR /home/pubaayaam/

RUN apt update -y && \
apt install nodejs -y && \
apt install npm -y && \
npm install -g yarn

RUN apt install telnet procps lsof -y

RUN npm install -g @angular/cli

WORKDIR /home/pubaayaam/ng-bootstrap
COPY . .
RUN npm install @ng-bootstrap/ng-bootstrap --legacy-peer-deps
RUN yarn install
RUN npm run build

# Stage 2: Serve app with nginx server

# Use official nginx image as the base image
FROM nginx:latest

# Copy the build output to replace the default nginx contents.
RUN mkdir -p /usr/share/nginx/html/img
COPY --from=build /home/pubaayaam/ng-bootstrap/demo/src/public/img/* /usr/share/nginx/html/img
COPY --from=build /home/pubaayaam/ng-bootstrap/demo/dist/* /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# devops~cloudops
RUN apt update -y && \
apt install telnet procps lsof -y

COPY entry.point .
RUN chmod +x entry.point
ENTRYPOINT ["./entry.point"]
18 changes: 18 additions & 0 deletions dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM debian:bookworm as build
WORKDIR /home/pubaayaam/

RUN apt update -y && \
apt install nodejs -y && \
apt install npm -y && \
npm install -g yarn

RUN apt install telnet procps lsof -y

RUN npm install -g @angular/cli

WORKDIR /home/pubaayaam/ng-bootstrap
COPY . .
RUN npm install @ng-bootstrap/ng-bootstrap --legacy-peer-deps
RUN yarn install
RUN npm run build
CMD ["tail", "-f","/dev/null"]
5 changes: 5 additions & 0 deletions entry.point
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

service nginx start &
/bin/bash

3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2209 docker build -t ngbootstrap_b:latest -f dockerfile .
2210 docker run --rm -it -p 80:80 --name ngb_c ngbootstrap_b:latest /bin/bash