Skip to content

Commit

Permalink
Init Dockerfile & containerized pulpito-ng
Browse files Browse the repository at this point in the history
Motivation:

We need a way to connect `pulpito-ng`
with `teuthology-api` + all other teuthology services.
Currently, we make use of docker containers to create
a development environment for `teuthology-api` and
other teuthology services.

Solution:

Created a Dockerfile and added a section in the README
file describing the process of connecting `pulpito-ng`
with otheer teuthology services such that we will be able
to containerize `pulpito-ng` and develop it along side
other services.

Signed-off-by: Kamoltat Sirivadhna <[email protected]>
  • Loading branch information
kamoltat committed Jul 19, 2023
1 parent 9be0d4d commit 28f9d5f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:alpine
RUN mkdir /app
WORKDIR /app
COPY package*.json /app
RUN npm install
COPY . /app
CMD ["npm", "start"]
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,34 @@ You'll need at least [node v17](https://nodejs.org/en/download). Once you've got

$ npm install
$ npm run start

## Integrate with teuthology docker setup

If you want to develop in a container environment
and connect to other teuthology services, here is what
you can do:

In [teuthology's docker-compose](https://github.com/ceph/teuthology/blob/main/docs/docker-compose/docker-compose.yml) replace `pulpito` service with the following:

```
pulpito:
build:
context: ../../../pulpito-ng
environment:
REACT_APP_PADDLES_SERVER: http://0.0.0.0:8080
depends_on:
paddles:
condition: service_healthy
teuthology_api:
condition: service_healthy
links:
- paddles
- teuthology_api
healthcheck:
test: [ "CMD", "curl", "-f", "http://0.0.0.0:8081" ]
timeout: 5s
interval: 10s
retries: 2
ports:
- 8081:8081
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "BROWSER=none react-scripts start",
"start": "PORT=8081 BROWSER=none react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down Expand Up @@ -67,4 +67,4 @@
"prismjs": "^1.29.0",
"react-scripts": "5.0.1"
}
}
}

0 comments on commit 28f9d5f

Please sign in to comment.