Skip to content

Commit

Permalink
Merge pull request #1 from git-malik/main
Browse files Browse the repository at this point in the history
Added Docker CI
  • Loading branch information
aledipa committed Jun 13, 2023
2 parents dd9b101 + b345902 commit a4a5546
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
Binary file added .github/img/docker-logo.webp
Binary file not shown.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_TOKEN_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN_PASS }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: d0ckmg/miniwikipedia:latest
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:20.3

EXPOSE 3000
ENV NODE_ENV=production
WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install --production
RUN npm ci --omit=dev

COPY . .

RUN npm run build

CMD [ "node", "dist/index.js"]
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

miniWikipedia is a website that lets you search every article on Wikipedia and gives you the concise summaries of any topic. It runs in Node.js and TypeScript.

## Installation
## Manual Installation

To run miniWikipedia locally, you need to have Node.js and npm installed on your machine. You also need to get an API key from Wikipedia to access their data. Follow these steps to set up the project:

Expand All @@ -13,6 +13,26 @@ To run miniWikipedia locally, you need to have Node.js and npm installed on your
5. Run the server: `node dist/index.js`
6. Open your browser and go to `http://localhost:3000` to see the website

## Docker Installation
<img src=".github/img/docker-logo.webp" width="400" height="100" />

It's possible to install the docker image of miniWikipedia by running this command:

`docker container run -p YOUR_PORT:3000 -d d0ckmg/miniwikipedia`

or alternatively, you can use a docker-compose file:

**docker-compose.yml**

```yaml
version: "3.9"
services:
node:
image: d0ckmg/miniwikipedia
container_name: miniwikipedia
ports:
- 3000:3000/tcp
```
## Usage

To use miniWikipedia, simply type a topic in the search box and click the search button or press 'enter'. While typing, below the input bar, will appear a text suggestion, to select it just click on it or press 'tab'.
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.9"
services:
node:
image: d0ckmg/miniwikipedia
container_name: miniwikipedia
ports:
- 3000:3000/tcp

0 comments on commit a4a5546

Please sign in to comment.