Merge pull request #1 from KevinMidboe/feat/drone-ci

Feat Drone ci
This commit is contained in:
2022-11-02 22:32:11 +01:00
committed by GitHub
4 changed files with 21 additions and 13 deletions

View File

@@ -74,3 +74,4 @@ trigger:
event:
include:
- push
- pull_request

View File

@@ -1,18 +1,14 @@
FROM node:18
LABEL org.opencontainers.image.source https://github.com/KevinMidboe/figlet-http
RUN mkdir -p /opt/figlet-http/src
RUN mkdir -p /opt/figlet-http/lib
WORKDIR /opt/figlet-http
COPY src/ src
COPY tsconfig.json .
COPY package.json .
COPY yarn.lock .
COPY lib/ lib
RUN yarn
RUN yarn build
RUN yarn install --production
EXPOSE 3000
CMD ["yarn", "start"]
CMD ["node", "lib/app.js"]

View File

@@ -56,15 +56,26 @@ Api endpoints `/text` & `/motd` have the following query options:
## Docker install
Run as a docker container using:
Run as a docker container from github container registry:
```bash
docker run -d \
sudo docker run -d \
--name figlet-http \
-p 3000:3000 \
ghcr.io/kevinmidboe/figlet-http
```
Run as docker locally:
```bash
yarn build; \
sudo docker build -t figlet-http .; \
sudo docker run -d \
--name figlet-http \
-p 3000:3000 \
figlet-http
```
## Systemd service
Example systemd config for running http server.

View File

@@ -7,8 +7,7 @@
},
"dependencies": {
"express": "^4.18.2",
"figlet": "^1.5.2",
"typescript": "^4.8.4"
"figlet": "^1.5.2"
},
"devDependencies": {
"@types/node": "^18.11.2",
@@ -16,6 +15,7 @@
"@typescript-eslint/parser": "^5.40.1",
"eslint": "^8.25.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0"
"eslint-plugin-import": "^2.26.0",
"typescript": "^4.8.4"
}
}