Added build for Fastify
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Danny Bessems 2022-01-20 15:16:21 +01:00
parent c7dabda145
commit 21bb235a3f
11 changed files with 58 additions and 5 deletions

View File

@ -3,9 +3,10 @@ type: kubernetes
name: Harbor
steps:
- name: build & publish
- name: 'Lowdefy: build & publish'
depends_on: [ clone ]
image: plugins/docker
context: .
context: ./Lowdefy
settings:
repo: bv11-cr01.bessems.eu/library/lowdefy
registry: bv11-cr01.bessems.eu
@ -15,6 +16,19 @@ steps:
from_secret: harbor_username
password:
from_secret: harbor_password
- name: 'Fastify: build & publish'
depends_on: [ clone ]
image: plugins/docker
context: ./Fastify
settings:
repo: bv11-cr01.bessems.eu/library/fastify
registry: bv11-cr01.bessems.eu
mtu: 1450
tags: latest
username:
from_secret: harbor_username
password:
from_secret: harbor_password
---
kind: pipeline
@ -22,9 +36,10 @@ type: kubernetes
name: Dockerhub
steps:
- name: build & publish
- name: 'Lowdefy: build & publish'
depends_on: [ clone ]
image: plugins/docker
context: .
context: ./Lowdefy
settings:
repo: djpbessems/lowdefy
mtu: 1450
@ -33,3 +48,15 @@ steps:
from_secret: docker_username
password:
from_secret: docker_password
- name: 'Fastify: build & publish'
depends_on: [ clone ]
image: plugins/docker
context: ./Fastify
settings:
repo: djpbessems/fastify
mtu: 1450
tags: latest
username:
from_secret: docker_username
password:
from_secret: docker_password

7
Fastify/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM node:17-alpine
RUN npm install fastify
COPY . .
CMD ["node", "server.js"]

18
Fastify/server.js Normal file
View File

@ -0,0 +1,18 @@
// Require the framework and instantiate it
const fastify = require('fastify')({ logger: true })
// Declare a route
fastify.get('/', async (request, reply) => {
return { hello: 'world' }
})
// Run the server!
const start = async () => {
try {
await fastify.listen(3001)
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
start()

View File

@ -1,4 +1,5 @@
FROM node:14-buster AS build
# FROM node:14-buster AS build
FROM node:17-alpine AS build
# Set working directory and node user
WORKDIR /home/node/lowdefy

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB