Skip to content

Instantly share code, notes, and snippets.

@bmvakili
Last active July 13, 2019 07:51
Show Gist options
  • Save bmvakili/ba5499f7fe032efd0ca5c56c62c3fe9e to your computer and use it in GitHub Desktop.
Save bmvakili/ba5499f7fe032efd0ca5c56c62c3fe9e to your computer and use it in GitHub Desktop.
liferay frontend development via docker container
FROM ubuntu
RUN apt-get update && \
apt-get -y install curl software-properties-common && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get update && \
apt-get -y install nodejs && \
useradd -m -s $(which bash) liferay && \
chown -R liferay:liferay /usr/lib/node_modules
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
COPY setup.sh /tmp/setup.sh
RUN chown liferay:liferay /tmp/setup.sh
USER liferay
RUN chmod +x /tmp/setup.sh && \
/tmp/setup.sh
#!/bin/bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source /home/liferay/.nvm/nvm.sh
nvm install v10.16.0
nvm use v10.16.0
which npm
npm install -g yo
npm install -g generator-liferay-theme
echo """
# Docker image is now built
docker run -it -d --name liferay-frontend-dev -v /opt/liferay-portal-bundle:/liferay-portal -v /opt/liferay-project:/liferay liferay-local-dev /bin/bash
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment