diff --git a/Dockerfile b/Dockerfile index babf7c1..c42e8b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,23 @@ -FROM node:14 +# Use the official Node.js image +FROM node:alpine -# Copy everything from the current directory into the Docker image -COPY . /app - -# Set working directory inside the container +# Set the working directory WORKDIR /app +# Copy package.json and yarn.lock +COPY package.json yarn.lock ./ + # Install dependencies RUN yarn install -# Compile TypeScript +# Copy the rest of the app +COPY . . + +# Build the app RUN yarn build -# Start command as defined in package.json +# Expose the port the app runs on +EXPOSE 3000 + +# Command to run the app CMD ["yarn", "start"]