Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile written for building docker image #395

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
29 changes: 29 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Loading