From 82d4f24b1ff66155c26eda8dae004571b7c1551c Mon Sep 17 00:00:00 2001 From: Sladyn Nunes Date: Wed, 3 Jun 2020 19:41:37 +0530 Subject: [PATCH] Add Dockerfile --- Dockerfile | 20 ++++++++++++++++++++ frontend/.dockerignore | 5 +++++ frontend/Dockerfile | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 Dockerfile create mode 100644 frontend/.dockerignore create mode 100644 frontend/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..da526f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Start with a base image containing Java runtime +FROM openjdk:8-jdk-alpine + +# Add Maintainer Info +LABEL maintainer="sladynnunes98@gmail.com" + +# Add a volume pointing to /tmp +VOLUME /tmp + +# Make port 8080 available to the world outside this container +EXPOSE 8080 + +# The application's jar file +ARG JAR_FILE=target/custom-distribution-service-0.0.1.jar + +# Add the application's jar to the container +ADD ${JAR_FILE} custom-distribution-service.jar + +# Run the jar file +ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/custom-distribution-service.jar"] \ No newline at end of file diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..56e8146 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,5 @@ +node_modules +build +.dockerignore +Dockerfile +Dockerfile.prod \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..c241592 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,20 @@ +# pull official base image +FROM node:13.12.0-alpine + +# set working directory +WORKDIR /app + +# add `/app/node_modules/.bin` to $PATH +ENV PATH /app/node_modules/.bin:$PATH + +# install app dependencies +COPY package.json ./ +COPY package-lock.json ./ +RUN npm install --silent +RUN npm install react-scripts@3.4.1 -g --silent + +# add app +COPY . ./ + +# start app +CMD ["npm", "start"] \ No newline at end of file