8 Commits

Author SHA1 Message Date
79836b065a feat(docker): using reg.cadoles.com to publish image 2024-02-26 15:20:26 +01:00
725fea2387 fix(dockerfile): updating build image
make the build faster and lighter
2024-02-26 14:56:58 +01:00
1dc731ca77 Merge branch 'develop' into feat/nonrootuser 2024-02-26 14:43:10 +01:00
1688b316a0 Merge pull request 'Mise à jour de la version NodeJS utilisée' (#3) from upgrade into develop
Reviewed-on: #3
Reviewed-by: pcaseiro <pcaseiro@cadoles.com>
2024-02-26 14:42:53 +01:00
816f939555 chore: update readme 2024-02-26 13:15:33 +01:00
30874a6de7 feat: upgrade node version & dependencies 2024-02-26 13:13:02 +01:00
987208dd03 feat(docker): do not run container as root
Using a non root user to execute the application.
We don't need to be root
2024-02-26 11:54:51 +01:00
84759ef783 Update nodejs version 2023-01-03 11:03:26 +01:00
4 changed files with 27 additions and 27 deletions

View File

@ -21,11 +21,11 @@ docker-run:
fake-sms:latest fake-sms:latest
docker-release: docker-release:
docker tag fake-sms:latest cadoles/fake-sms:latest docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:latest
docker tag fake-sms:latest cadoles/fake-sms:$(DOCKER_DATE_TAG) docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
docker login docker login reg.cadoles.com
docker push cadoles/fake-sms:latest docker push reg.cadoles.com/cadoles/fake-sms:latest
docker push cadoles/fake-sms:$(DOCKER_DATE_TAG) docker push reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
test: test:
go test -v -race ./... go test -v -race ./...

View File

@ -75,10 +75,10 @@ Un exemple d'appel à l'API est disponible dans le fichier [`misc/powow.http`](.
### Dépendances ### Dépendances
- Go 1.13 - Go 1.17
- modd - modd
- make - make
- NodeJS/npm - NodeJS (20.x) / npm
### Compiler et démarrer le serveur de développement ### Compiler et démarrer le serveur de développement

View File

@ -1,14 +1,11 @@
FROM golang:1.17 AS build FROM reg.cadoles.com/dh/library/golang:1.22-alpine AS build
ARG HTTP_PROXY= ARG HTTP_PROXY=
ARG HTTPS_PROXY= ARG HTTPS_PROXY=
ARG http_proxy= ARG http_proxy=
ARG https_proxy= ARG https_proxy=
RUN apt-get update && apt-get install -y build-essential git bash curl python2 RUN apk update && apk add --no-cache build-base git bash curl python3 nodejs npm
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs
COPY . /src COPY . /src
@ -16,19 +13,22 @@ WORKDIR /src
RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml
RUN go get github.com/krishicks/yaml-patch/cmd/yaml-patch RUN go install github.com/krishicks/yaml-patch/cmd/yaml-patch@v0.0.10
RUN npm install \ RUN npm install \
&& make vendor \ && make vendor \
&& echo "---" > ./misc/release/config-patch.yml \ && echo "---" > ./misc/release/config-patch.yml \
&& make ARCH_TARGETS=amd64 release && make ARCH_TARGETS=amd64 release
FROM busybox FROM busybox
COPY --from=build /src/release/fake-sms-linux-amd64 /app RUN adduser -D -h /app sms
COPY --from=build /src/release/fake-sms-linux-amd64 /app
RUN chown -R sms:sms /app
USER sms
WORKDIR /app WORKDIR /app
RUN mkdir -p /app
CMD ["bin/fake-sms", "--config", "config.yml"] CMD ["bin/fake-sms", "--config", "config.yml"]

View File

@ -11,21 +11,21 @@
"author": "Cadoles <contact@cadoles.com>", "author": "Cadoles <contact@cadoles.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.7", "@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.20.2", "@babel/preset-env": "^7.23.9",
"babel-loader": "^9.1.0", "babel-loader": "^9.1.3",
"bulma": "^0.9.4", "bulma": "^0.9.4",
"bulma-switch": "^2.0.4", "bulma-switch": "^2.0.4",
"css-loader": "^6.7.3", "css-loader": "^6.10.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"mini-css-extract-plugin": "^2.7.2", "mini-css-extract-plugin": "^2.8.0",
"node-sass": "~8.0", "node-sass": "~9.0",
"resolve-url-loader": "^5.0.0", "resolve-url-loader": "^5.0.0",
"sass-loader": "^13.2.0", "sass-loader": "^14.1.1",
"stimulus": "^3.2.1", "stimulus": "^3.2.2",
"style-loader": "^3.3.1", "style-loader": "^3.3.4",
"webpack": "^5.75.0", "webpack": "^5.90.3",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.1.4"
} }
} }