-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e035624
commit ae9f6b1
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
ARG VERSION | ||
FROM node:lts-alpine AS build | ||
|
||
ARG VERSION | ||
ARG FULLVERSION | ||
ARG CHANNEL | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
LABEL dev.joryirving.image.target_platform=$TARGETPLATFORM | ||
LABEL dev.joryirving.image.target_architecture=$TARGETARCH | ||
LABEL dev.joryirving.image.target_os=$TARGETOS | ||
LABEL org.opencontainers.image.source="https://github.com/CorentinTh/it-tools" | ||
|
||
RUN \ | ||
apk add --no-cache curl git \ | ||
&& git clone https://github.com/CorentinTh/it-tools.git /app \ | ||
&& cd /app \ | ||
&& git checkout $FULLVERSION | ||
|
||
WORKDIR /app | ||
|
||
RUN \ | ||
corepack enable \ | ||
&& corepack prepare pnpm@latest --activate \ | ||
&& pnpm install --prefer-offline \ | ||
&& pnpm build | ||
|
||
FROM nginxinc/nginx-unprivileged:alpine | ||
|
||
USER root | ||
RUN \ | ||
apk add --no-cache \ | ||
catatonit | ||
|
||
USER nginx | ||
|
||
COPY --chown=101:101 --from=build /app/dist/ /usr/share/nginx/html/ | ||
COPY --chown=101:101 --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
RUN \ | ||
sed -i "s/worker_processes auto;/worker_processes 2;/g" /etc/nginx/nginx.conf \ | ||
&& sed -i "s/80;/8080;/g" /etc/nginx/conf.d/default.conf | ||
|
||
ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml | ||
process: | ||
nginx: | ||
running: true | ||
|
||
port: | ||
tcp:8080: | ||
listening: true | ||
|
||
http: | ||
http://localhost:8080: | ||
status: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
version="$(curl -sX GET "https://api.github.com/repos/CorentinTh/it-tools/releases/latest" | jq --raw-output '.tag_name' || true)" | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
fullversion="${version#*release-}" | ||
version="${version%%-*}" | ||
printf "%s" "${version}" | ||
printf "%s" "${fullversion}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env sh | ||
#shellcheck disable=SC2086 | ||
|
||
if [ -n "${HTTP_WORKERS}" ]; then | ||
sed -i "s/worker_processes 2;/worker_processes ${HTTP_WORKERS};/g" /etc/nginx/nginx.conf | ||
fi | ||
|
||
if [ -n "${HTTP_PORT}" ]; then | ||
sed -i "s/8080;/${HTTP_PORT};/g" /etc/nginx/conf.d/default.conf | ||
fi | ||
|
||
nginx -g "daemon off;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
app: it-tools | ||
semver: true | ||
channels: | ||
- name: stable | ||
platforms: ["linux/amd64", "linux/arm64"] | ||
stable: true | ||
tests: | ||
enabled: true | ||
type: web |