Skip to content

Commit 0d43e6c

Browse files
committed
add docker compose and build image
1 parent 7602c78 commit 0d43e6c

7 files changed

+40
-28
lines changed

.dockerignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/node_modules_AAAA
2+
Dockerfile
3+
.dockerignore
4+
.git
5+
**.gitignore
6+
.npmignore
7+
.env*
8+
docker-compose.*
9+
kind.*
10+
.eslintrc.js
11+
README.md
12+
**/dist_AAAAA

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules
66

77
notes.txt
88
kubeconfig
9+
kubeconfig*
910

1011
example-*.json
1112

Dockerfile

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
# Sample copied from https://github.com/nodeshift-starters/devfile-sample/blob/main/Dockerfile
1+
FROM node:18-alpine
2+
ENV NODE_ENV=production
23

3-
# Install the app dependencies in a full Node docker image
4-
FROM registry.access.redhat.com/ubi8/nodejs-14:latest
4+
WORKDIR /app
55

6-
# Copy package.json and package-lock.json
7-
COPY package*.json ./
6+
COPY dist ./server
7+
COPY package.json ./server/package.json
8+
COPY node_modules ./server/node_modules
9+
COPY client/dist ./client/dist
810

9-
# Install app dependencies
10-
RUN npm install --production
11-
12-
# Copy the dependencies into a Slim Node docker image
13-
FROM registry.access.redhat.com/ubi8/nodejs-14-minimal:latest
14-
15-
# Install app dependencies
16-
COPY --from=0 /opt/app-root/src/node_modules /opt/app-root/src/node_modules
17-
COPY . /opt/app-root/src
18-
19-
ENV NODE_ENV production
20-
ENV PORT 3000
21-
22-
CMD ["npm", "start"]
11+
CMD [ "node", "index.js" ]

docker-compose.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3.9" # optional since v1.27.0
2+
services:
3+
kubero:
4+
container_name: "kubero"
5+
build: .
6+
command: ["tail", "-f", "/dev/null"]
7+
env_file:
8+
- .env
9+
ports:
10+
- "8000:3000"
11+
extra_hosts:
12+
- "kubero-control-plane:192.168.65.2"
13+
volumes:
14+
#- .:/app
15+
- ./kubeconfig-docker:/app/server/kubeconfig
16+
- ./config.yaml:/app/server/config.yaml

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"name": "keroku",
2+
"name": "kubero",
33
"version": "1.0.0",
44
"description": "Heroku clone on Kubernetes",
55
"main": "dist/index.js",
66
"author": "Gianni Carafa",
7-
"license": "MIT",
87
"scripts": {
98
"install": "npx tsc",
109
"build": "npx tsc",

src/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,4 @@ const staticConf = { maxAge: '1s', etag: false };
2424
app.use(history());
2525
app.use(express.static(publicPath, staticConf));
2626

27-
app.get('/', (req: Request, res: Response) => {
28-
res.render(path.join(__dirname + '/client/dist/index.html'))
29-
});
30-
31-
3227
server.listen(port, () => debug.log(`⚡️[server]: Server is running at http://127.0.0.1:${port}`));

src/keroku.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class Keroku {
138138
items: new Array()
139139
}
140140
for (const pipeline of pipelines.items) {
141-
debug.log('pipeline: '+pipeline.spec.name);
141+
debug.debug('listed pipeline: '+pipeline.spec.name);
142142
ret.items.push(pipeline.spec);
143143
}
144144
return ret;
@@ -498,7 +498,7 @@ export class Keroku {
498498

499499
logStream.on('data', (chunk: any) => {
500500
// use write rather than console.log to prevent double line feed
501-
process.stdout.write(chunk);
501+
//process.stdout.write(chunk);
502502
const roomname = `${pipelineName}-${phaseName}-${appName}`;
503503
this._io.to(roomname).emit('log', {
504504
id: uuidv4(),

0 commit comments

Comments
 (0)