Skip to content

Instantly share code, notes, and snippets.

@berlinbrown
Created April 9, 2020 14:43
Show Gist options
  • Save berlinbrown/cab2c5eae6f13a69390a87cef241b208 to your computer and use it in GitHub Desktop.
Save berlinbrown/cab2c5eae6f13a69390a87cef241b208 to your computer and use it in GitHub Desktop.
Dockerfile Amazon And ibm db and node
# Build stage
FROM amazonlinux:latest as build-stage
#FROM node:10 as build-stage
WORKDIR /app
COPY app/ ./
COPY .npmrc ./
# From IBM documentation:
RUN yum install -y add make gcc gcc-c++
RUN yum install -y kernel-devel
RUN yum install -y openssl-devel bzip2-devel
RUN yum install -y python2
RUN yum install -y wget tar gzip
RUN yum install -y curl
#RUN wget http://nodejs.org/dist/v0.9.11/node-v0.9.11.tar.gz && \
# tar -zxvf node-v0.9.11.tar.gz && \
# cd node-v0.9.11 && ./configure && make && \
# make install
#RUN yum install --enablerepo=epel -y nodejs
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
RUN yum install -y nodejs
RUN npm install bcrypt
RUN npm install --unsafe-perm ibm_db
RUN npm install --unsafe-perm && npm run build
# Production stage
FROM amazonlinux:latest as production-stage
#RUN useradd -ms /bin/bash node
#USER node
WORKDIR /app
#COPY --from=build-stage --chown=node:node /app .
COPY --from=build-stage /app .
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# From IBM documentation:
RUN yum install -y add make gcc gcc-c++
RUN yum install -y kernel-devel
RUN yum install -y openssl-devel bzip2-devel
RUN yum install -y python2
RUN yum install -y wget tar gzip
RUN yum install -y curl
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
RUN yum install -y nodejs
#USER node
ENTRYPOINT ["docker-entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment