diff --git a/Taipei-City-Dashboard-FE/Dockerfile b/Taipei-City-Dashboard-FE/Dockerfile index f5fbe0ec..914bc250 100644 --- a/Taipei-City-Dashboard-FE/Dockerfile +++ b/Taipei-City-Dashboard-FE/Dockerfile @@ -1,9 +1,21 @@ -FROM node:20.11.1-alpine3.19 +# Use the official lightweight Node.js 18 image. +# https://hub.docker.com/_/node +FROM node:19-alpine -WORKDIR /opt/aipei-City-Dashboard-FE +# Create and change to the app directory. +WORKDIR /usr/src/app -COPY ./ ./ +# Copy application dependency manifests to the container image. +# A wildcard is used to ensure both package.json AND package-lock.json are copied. +# Copying this separately prevents re-running npm install on every code change. +COPY package*.json ./ +# Install dependencies. +# If you add a package-lock.json speed your build by switching to 'npm ci'. RUN npm install -CMD ["npm", "start"] \ No newline at end of file +# Copy local code to the container image. +COPY . ./ + +# Run the web service on container startup. +CMD ["npm", "run", "dev"]