lesson 9
This commit is contained in:
23
nodeJS/Learning/07/app/Dockerfile
Normal file
23
nodeJS/Learning/07/app/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# Use Base Image: What we are using to make Docker File, eg ubuntu container/ image, node etc
|
||||
FROM node:lts-alpine
|
||||
|
||||
# Make Dir (make sure directory exists)
|
||||
RUN mkdir -p /usr/src/app
|
||||
|
||||
# Set the working directory: using the correct folder
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy files into folder (no need to reinstall every single time)
|
||||
COPY package.json .
|
||||
|
||||
# Install the dependencies
|
||||
RUN yarn install
|
||||
|
||||
# Copy the rest of the files
|
||||
COPY . .
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 3000
|
||||
|
||||
# Execute Command
|
||||
CMD ["yarn", "dev"]
|
||||
Reference in New Issue
Block a user