-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build and run from Docker Support
Build and run the generator from docker image support added. The main aim and motivation behind doing this is, because of a no. of different jhipster blueprints are there, which are compatible and works with the different version of jhipster and also might be incompatible with other blueprints or versions of jhipster. Signed-off-by: Pratik Raj <[email protected]>
- Loading branch information
1 parent
052e0d5
commit c951c0a
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM ubuntu:20.04 | ||
RUN \ | ||
# configure the "jhipster" user | ||
groupadd jhipster && \ | ||
useradd jhipster -s /bin/bash -m -g jhipster -G sudo && \ | ||
echo 'jhipster:jhipster' |chpasswd && \ | ||
mkdir /home/jhipster/app && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
export TZ=Europe\Paris && \ | ||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ | ||
apt-get update && \ | ||
# install utilities | ||
apt-get install -y \ | ||
wget \ | ||
sudo && \ | ||
# install node.js | ||
wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.gz -O /tmp/node.tar.gz && \ | ||
tar -C /usr/local --strip-components 1 -xzf /tmp/node.tar.gz && \ | ||
# upgrade npm | ||
npm install -g npm && \ | ||
# install yeoman | ||
npm install -g yo && \ | ||
# cleanup | ||
apt-get clean && \ | ||
rm -rf \ | ||
/home/jhipster/.cache/ \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* | ||
|
||
# install jhipster | ||
RUN npm install -g generator-jhipster | ||
|
||
RUN \ | ||
# install the blueprint | ||
npm install -g generator-jhipster-primeng-blueprint && \ | ||
# fix jhipster user permissions | ||
chown -R jhipster:jhipster \ | ||
/home/jhipster \ | ||
/usr/local/lib/node_modules && \ | ||
# cleanup | ||
rm -rf \ | ||
/home/jhipster/.cache/ \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* | ||
|
||
# expose the working directory | ||
USER jhipster | ||
ENV PATH $PATH:/usr/bin | ||
WORKDIR "/home/jhipster/app" | ||
VOLUME ["/home/jhipster/app"] | ||
CMD ["jhipster", "--blueprints", "primeng-blueprint", "--skip-checks"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters