Skip to content

Commit

Permalink
docker image created for rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
yashkathe committed May 29, 2024
1 parent 181ba20 commit 34402ec
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .Dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github
.git
.vscode
dist
node_modules
.env_example.txt
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

RUN npm run build

ENV PORT 80

EXPOSE ${PORT}

CMD ["npm", "run", "start-api"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ The scraper scrapes this website: <https://www.formula1.com>
npm i f1-api-node
```

# Accessing API through Docker

The docker image of the rest api can be found on [Docker Hub](https://hub.docker.com/repository/docker/katheyash/f1-api-node/general)

- ## Pull the Image and start the development in no time:

```bash
docker push katheyash/f1-api-node:tagname
```

- ## The default port is 80

```bash
docker run -p 80:80 --name f1-api-node-test-1 katheyash/f1-api-node:1
```

- ## If .env file exists

```bash
docker run --env-file ./.env -p 3001:3001 --name f1-api-node-test-1 f1-api-node:1
```

# Example snippet

The following function will print the current lineup of F1 drivers.
Expand Down

0 comments on commit 34402ec

Please sign in to comment.