Skip to content

Commit ed79e4c

Browse files
Pedro SandersPedro Sanders
authored andcommitted
feat: implement the im-processor example
1 parent e3b28d3 commit ed79e4c

File tree

10 files changed

+1752
-1627
lines changed

10 files changed

+1752
-1627
lines changed

.github/workflows/gh_docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Publish
1313
uses: elgohr/Publish-Docker-Github-Action@master
1414
with:
15-
name: fonoster/nodejs-service
15+
name: fonoster/nodejs-processor
1616
username: ${{ secrets.DOCKER_HUB_USERNAME }}
1717
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
1818
workdir: .

Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ LABEL Fonoster Team <[email protected]>
77
COPY . /build
88
WORKDIR /build
99

10-
RUN npm install && npm run build
10+
RUN apk add --no-cache git python3 make g++ && \
11+
npm install && \
12+
npm run build && \
13+
npm pack
1114

1215
##
1316
## Runner
1417
##
15-
FROM gcr.io/distroless/nodejs:18 as runner
18+
FROM node:lts-alpine as runner
1619

17-
COPY --from=builder /build/dist/bundle.js /app/bundle.js
20+
COPY --from=builder /build/nodejs-processor-*.tgz .
1821

19-
WORKDIR /app
22+
RUN apk add --no-cache git python3 make g++ && \
23+
npm install -g nodejs-processor-*.tgz && \
24+
rm -f nodejs-processor-*.tgz && \
25+
rm -rf /var/cache/apk/* \
26+
rm -rf /tmp/* \
27+
apk del git python3 make g++
2028

21-
CMD ["./bundle.js"]
29+
CMD [ "runner" ]

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Fonoster {Service Name}
1+
# Routr {Proccessor Name}
22

33
> {A short description of the image, same as the Github Repo description.}
44
55
{Badges should all be in one row without carriage returns. Replace the {name} with your docker image name.}
66

7-
<a href="https://gitpod.io/#https://github.com/fonoster/nodejs-service"> <img src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod" alt="Contribute with Gitpod" /> </a> [![publish to docker hub](https://github.com/fonoster/nodejs-service/actions/workflows/gh_docker.yml/badge.svg)](https://github.com/fonoster/nodejs-service/actions/workflows/gh_docker.yml)
7+
<a href="https://gitpod.io/#https://github.com/fonoster/ "> <img src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod" alt="Contribute with Gitpod" /> </a> [![publish to docker hub](https://github.com/fonoster/nodejs-processor/actions/workflows/gh_docker.yml/badge.svg)](https://github.com/fonoster/nodejs-processor/actions/workflows/gh_docker.yml)
88

99
{Longer description of what the image provides.}
1010

11-
Please read the [documentation](link) on how Fonoster services are created and how to work with them.
11+
Please read the [documentation]() on how Fonoster services are created and how to work with them.
1212

1313
## Available Versions
1414

@@ -21,14 +21,14 @@ You can see all images available to pull from Docker Hub via the [Tags]() page.
2121
You can clone this repository and manually build it.
2222

2323
```
24-
cd fonoster/{service}\:%%VERSION%%
25-
docker build -t fonoster/{service}:%%VERSION%% .
24+
cd fonoster/routr-{processor}\:%%VERSION%%
25+
docker build -t fonoster/routr-{processor}:%%VERSION%% .
2626
```
2727

2828
Otherwise, you can pull this image from the docker index.
2929

3030
```
31-
docker pull fonoster/{service}:%%VERSION%%
31+
docker pull fonoster/routr-{processor}:%%VERSION%%
3232
```
3333

3434
## Usage Example
@@ -65,7 +65,7 @@ Environment variables are used in the entry point script to render configuration
6565

6666
## Exposed ports
6767

68-
- `3000` - Default application port for HTTP
68+
- `51904` - Default Processor port
6969

7070
## Volumes
7171

@@ -85,7 +85,7 @@ Please read [CONTRIBUTING.md](https://github.com/fonoster/fonoster/blob/master/C
8585

8686
- [Pedro Sanders](https://github.com/psanders)
8787

88-
See the List of contributors who [participated](https://github.com/fonoster/nodejs-service/contributors) in this project.
88+
See the List of contributors who [participated](https://github.com/fonoster/nodejs-processor/contributors) in this project.
8989

9090
## License
9191

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
version: '3.7'
1+
version: "3.9"
22

33
services:
4-
nodejsservice:
4+
nodejs-processor:
55
build:
66
context: .
7-
image: fonoster/nodejsservice:latest
7+
image: fonoster/nodejs-processor:latest
88
restart: always
99
ports:
10-
- 3000:3000
10+
- 51904:51904
1111
environment:
1212
LOGS_LEVEL: verbose
13+
LOCATION_ADDR: ${LOCATION_ADDR}
1314
# Uncomment the following line to enable fluent transport
1415
# LOGS_TRANSPORT: fluent

0 commit comments

Comments
 (0)