diff --git a/README.md b/README.md index db61563b..c213c075 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,39 @@ Then, complete the information in your .env file with the firebase information, npm run serve ``` + + + +## Docker Setup + + + +### Building the Docker Image + +To build the Docker image for UX Remote LAB, navigate to the project's root directory and run the following command: + +```bash +docker build -t uxremotelab . +``` + +### Running the Application using Docker + +After building the image, you can run the application in a Docker container using: + + +Note: Ensure you have created the .env file and filled it with all required variables before running the following command: + + +```bash +docker run -d --env-file .env -p 5000:5000 uxremotelab +``` + +Visit `http://localhost:5000` in your browser to access the UX Remote LAB platform. + + + + + ## License MIT © [UX Remote LAB](https://github.com/uramakilab/remote-usability-lab) diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..6069a6e7 --- /dev/null +++ b/dockerfile @@ -0,0 +1,29 @@ +FROM node:lts AS build-stage + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +# Run build as per the script defined in package.json +RUN npm run build + +# Production stage using a minimal Node.js image +FROM node:alpine AS production-stage + +# Install 'serve' to serve the application +RUN npm install -g serve + +WORKDIR /app + +# Copy the built application from the build stage +COPY --from=build-stage /app/dist /app + +# Expose the port that 'serve' will run on +EXPOSE 5000 + +# Command to serve the application on port 5000 +CMD ["serve", "-s", ".", "-l", "5000"]