igorferreira
4/9/2018 - 5:48 PM

Dockerfile-node8-java8-centos7

FROM centos/nodejs-8-centos7:latest
MAINTAINER igorferreira.noorden@sulamerica.com.br

ENV \
  HOME=/opt/app-root/src \
  PATH=/opt/app-root/src/bin:/opt/app-root/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$PATH

USER root

# Upgrading system
RUN yum -y install epel-release; yum clean all 
RUN yum -y update; yum clean all
RUN yum -y upgrade

# JAVA_APP_DIR is used by run-java.sh for finding the binaries
ENV JAVA_APP_DIR=/deployments \
    JAVA_MAJOR_VERSION=8

# /dev/urandom is used as random source, which is prefectly safe
# according to http://www.2uo.de/myths-about-urandom/
RUN yum install -y \
       java-1.8.0-openjdk  \
       java-1.8.0-openjdk-devel \
    && echo "securerandom.source=file:/dev/urandom" >> /usr/lib/jvm/java/jre/lib/security/java.security


ENV JAVA_HOME /etc/alternatives/jre

#RUN yum install -y gcc php-devel php-pear ImageMagick ImageMagick-devel
RUN yum install -y gcc ImageMagick ImageMagick-devel

# install shortlink-extractor
RUN mkdir -p ${HOME}

COPY . ${HOME}

WORKDIR ${HOME}

# permissoes no home da app
RUN chmod -R 755 ${HOME}/node_modules/appdynamics* && \ 
    chmod -R 777 ${HOME}/src

EXPOSE 8080

CMD npm start