From 95675b90bf6c01743ffba0b363f768693f3d38a8 Mon Sep 17 00:00:00 2001 From: Omer Sabic Date: Wed, 29 May 2024 21:38:01 +0200 Subject: [PATCH] dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5248070 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:18-alpine + +# Create app directory +WORKDIR /usr/src/app + +RUN npm install -g yarn + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) and yarn.lock because we are using yarn +COPY package*.json yarn.lock ./ + +# Run yarn without generating a yarn.lock file +RUN yarn --pure-lockfile + +# Bundle app source +COPY . ./ + +# Use the port used by our server.js configuration +EXPOSE 3000 + +# This will run `yarn start` when the docker image is ran +CMD [ "yarn", "start" ] \ No newline at end of file