-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (16 loc) · 728 Bytes
/
Dockerfile
File metadata and controls
22 lines (16 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM node
# image from https://hub.docker.com/
WORKDIR /usr/app
COPY package.json ./
# Copy package.json (from localhost) into workdir in container
RUN npm install
# Runs terminal command, RUN is for an image build step
# A Dockerfile can have many RUN steps stacked
COPY . .
# Copy all current dir content (from localhost) into workdir in container
EXPOSE 3333
# A container runs in an isolated environment. Thus, it has a different IP than the local host.
# We must tell which port will be exposed.
CMD ["npm", "run", "dev"]
# Defines a default command. It can be overridden when executing: $ docker run COMMAND "command"
# Doesn't run at image building ste, executes when launching or running the image (already built).