Last active
November 30, 2022 14:02
-
-
Save pablocattaneo/d298ea448f4c958d74c1d8ccb2b42659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a file and name it Dockerfile | |
FROM node:lts #baseimage | |
WORKDIR /app #The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. | |
COPY . /app #The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>. | |
RUN yarn global add gatsby-cli #The RUN instruction will execute any commands in a new layer on top of the current image and commit the results. The resulting committed image will be used for the next step in the Dockerfile. | |
RUN yarn install | |
EXPOSE 80 | |
CMD ["yarn", "develop"] # There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect. The main purpose of a CMD is to provide defaults for an executing container. These defaults can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT instruction as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment