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

Add Dockerfile and docker-compose.yml for the containerization of the Chooser repository. #517

Merged
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
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://hub.docker.com/_/node/
FROM node:14

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install

EXPOSE 8080

CMD ["npm", "run", "serve"]
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,50 @@ Tasks, issues, and discussion related to the release of the new chooser are trac

## Getting Started

## Using Docker

Before proceeding, ensure you have Docker installed on your local machine. If not, download and install Docker Desktop by visiting [Docker's official website](https://www.docker.com/products/docker-desktop) and follow the installation instructions.

To deploy the Creative Commons Chooser application using Docker, follow these steps:

### Step 1: Install Docker Desktop

First, ensure you have Docker Desktop installed on your local machine. Open Docker Desktop app on your local machine and follow the installation instructions.

### Step 2: Clone the Repository

Clone the Creative Commons Chooser repository to your local machine:

```bash
git clone https://github.com/creativecommons/chooser.git
```

### Step 3: Navigate to the Project Directory

Navigate into the project directory:

```bash
cd chooser
```

### Step 4: Build and Run the Docker Container

In order to have the code up and running on your machine, build the Docker container using docker-compose:

```bash
docker-compose up
```

### Step 5: Access the Application

Once the container is running, you can access the Creative Commons Chooser application by navigating to the following URL in your web browser:

```
http://localhost:8080
```

## Manual Setup

### Prerequisite
[nodeJS](https://nodejs.org/en/blog/release/v14.17.3) version 14 or below, as the version above 14 may give error.

Expand Down
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use docker compose v2 for non swarm deployments
# https://docs.docker.com/compose/compose-file/compose-file-v2/
version: '2.4'

services:

web:
# Build configuration in Dockerfile
build: .

# Keep stdin open even if not attached
stdin_open: true

restart: on-failure

# Allocate a pseudo-TTY
tty: true

# Port mapping: Map host port 8080 to container port 8080
ports:
- '8080:8080'

volumes:
# Mount the current directory from the host to /app in the container
- '.:/app'
# Mount the /app/node_modules directory from the host
- '/app/node_modules'
Loading