Added build for Fastify
Some checks failed
continuous-integration/drone/push Build is failing

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 name: Harbor
steps: steps:
- name: build & publish - name: 'Lowdefy: build & publish'
depends_on: [ clone ]
image: plugins/docker image: plugins/docker
context: . context: ./Lowdefy
settings: settings:
repo: bv11-cr01.bessems.eu/library/lowdefy repo: bv11-cr01.bessems.eu/library/lowdefy
registry: bv11-cr01.bessems.eu registry: bv11-cr01.bessems.eu
@ -15,6 +16,19 @@ steps:
from_secret: harbor_username from_secret: harbor_username
password: password:
from_secret: harbor_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 kind: pipeline
@ -22,9 +36,10 @@ type: kubernetes
name: Dockerhub name: Dockerhub
steps: steps:
- name: build & publish - name: 'Lowdefy: build & publish'
depends_on: [ clone ]
image: plugins/docker image: plugins/docker
context: . context: ./Lowdefy
settings: settings:
repo: djpbessems/lowdefy repo: djpbessems/lowdefy
mtu: 1450 mtu: 1450
@ -33,3 +48,15 @@ steps:
from_secret: docker_username from_secret: docker_username
password: password:
from_secret: docker_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 # Set working directory and node user
WORKDIR /home/node/lowdefy 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