Skip to content

Commit

Permalink
Removed Development Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav-26 committed Jun 29, 2021
1 parent 15fb00e commit ba07109
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 145 deletions.
43 changes: 0 additions & 43 deletions django-app/Dockerfile_v2

This file was deleted.

20 changes: 0 additions & 20 deletions flask-app/Dockerfile_v2

This file was deleted.

31 changes: 24 additions & 7 deletions node-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
#Base Image
# Base Image
From node:12.18.1

#Seeting up env as production
# Seeting up env as production
ENV NODE_ENV=production

#Making /app dir as working dir
#Getting System Ready to install dependencies
RUN apt-get clean \
&& apt-get -y update

# Installing nginx
RUN apt-get -y install nginx \
&& apt-get -y install python3-dev \
&& apt-get -y install build-essential

# Creating symbolic link for access and error log from nginx
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log


# Making /app dir as working dir
WORKDIR /app

#Adding complete files and dirs in app dir in container
# Adding complete files and dirs in app dir in container
ADD . /app/

#Installing dependencies
COPY nginx.default /etc/nginx/sites-available/default

# Installing dependencies
RUN npm install --production
RUN npm i -g pm2

#Starting Server
CMD [ "node", "src/index.js" ]
# Starting Server
CMD ["sh", "-c", "service nginx start ; pm2-runtime src/index.js -i 0"]

35 changes: 0 additions & 35 deletions node-app/Dockerfile.prod

This file was deleted.

34 changes: 26 additions & 8 deletions react-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
#Base Image
From node:12.18.1
###### BUILD ENVIRONMENT ######

#Making /app dir as working dir
# Base Image
FROM node:12.18.1 as build

# Moving into working directory
WORKDIR /app

#Adding complete files and dirs in app dir in container
# Adding all files and dirs to /app inside container
ADD . /app/

#Installing dependencies
RUN npm install
# Installing dependencies
RUN npm install

# Creating Production build for react-app
RUN npm run build

# In this dockerfile using the concept of docker multistage build

###### PRODUCTION ENVIRONMENT ######

# Base Image for prod env
FROM nginx:stable-alpine

# Adding the build files from previous container to nginx/html
COPY --from=build /app/build /usr/share/nginx/html

# Exposing port 80 to listen http requests
EXPOSE 80

#Starting Server
CMD [ "yarn", "start" ]
# Command to run
CMD ["nginx", "-g", "daemon off;"]
32 changes: 0 additions & 32 deletions react-app/Dockerfile.prod

This file was deleted.

0 comments on commit ba07109

Please sign in to comment.