From 219a75fb1e1b1c3efb73e9b07ce6d3ea63924769 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Fri, 13 Dec 2024 19:39:25 +0100 Subject: [PATCH] refactor(idp): Dockerfile uses binary, remove qodana.yaml --- api/.gitignore | 3 --- api/Dockerfile | 4 ++-- api/qodana.yaml | 29 ----------------------------- console/qodana.yaml | 29 ----------------------------- conversion/.gitignore | 4 ---- conversion/Dockerfile | 2 +- conversion/qodana.yaml | 29 ----------------------------- idp/Dockerfile | 16 +++++++++++++--- idp/deno.json | 2 +- idp/qodana.yaml | 30 ------------------------------ language/qodana.yaml | 29 ----------------------------- mosaic/.gitignore | 4 ---- mosaic/Dockerfile | 4 ++-- mosaic/qodana.yaml | 29 ----------------------------- ui/qodana.yaml | 30 ------------------------------ voltaserve.code-workspace | 3 +++ webdav/.gitignore | 4 ---- webdav/Dockerfile | 4 ++-- webdav/qodana.yaml | 29 ----------------------------- 19 files changed, 24 insertions(+), 260 deletions(-) delete mode 100644 api/qodana.yaml delete mode 100644 console/qodana.yaml delete mode 100644 conversion/qodana.yaml delete mode 100644 idp/qodana.yaml delete mode 100644 language/qodana.yaml delete mode 100644 mosaic/qodana.yaml delete mode 100644 ui/qodana.yaml delete mode 100644 webdav/qodana.yaml diff --git a/api/.gitignore b/api/.gitignore index de049f060..2aa3591eb 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1,4 +1 @@ /.env.local -/voltaserve -/__debug_bin* -/.air diff --git a/api/Dockerfile b/api/Dockerfile index 85df19362..2f39e7eeb 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -12,7 +12,7 @@ FROM golang:1.22-alpine AS builder WORKDIR /build -COPY go.mod go.sum . +COPY go.mod go.sum ./ RUN go mod download @@ -20,7 +20,7 @@ COPY . . RUN go build -o voltaserve-api -FROM golang:1.22-alpine AS runner +FROM alpine:3.21 AS runner WORKDIR /app diff --git a/api/qodana.yaml b/api/qodana.yaml deleted file mode 100644 index 215d80806..000000000 --- a/api/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-go:latest diff --git a/console/qodana.yaml b/console/qodana.yaml deleted file mode 100644 index 84e3e499b..000000000 --- a/console/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-python:latest diff --git a/conversion/.gitignore b/conversion/.gitignore index 65112857f..2aa3591eb 100644 --- a/conversion/.gitignore +++ b/conversion/.gitignore @@ -1,5 +1 @@ /.env.local -/voltaserve -__debug_bin* -/*.tsv -/.air diff --git a/conversion/Dockerfile b/conversion/Dockerfile index 476959367..65eb23887 100644 --- a/conversion/Dockerfile +++ b/conversion/Dockerfile @@ -12,7 +12,7 @@ FROM golang:1.22-bookworm AS builder WORKDIR /build -COPY go.mod go.sum . +COPY go.mod go.sum ./ RUN go mod download diff --git a/conversion/qodana.yaml b/conversion/qodana.yaml deleted file mode 100644 index 215d80806..000000000 --- a/conversion/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-go:latest diff --git a/idp/Dockerfile b/idp/Dockerfile index c9c30af67..010a9fda4 100644 --- a/idp/Dockerfile +++ b/idp/Dockerfile @@ -8,9 +8,9 @@ # by the GNU Affero General Public License v3.0 only, included in the file # AGPL-3.0-only in the root of this repository. -FROM denoland/deno:alpine-2.1.4 +FROM denoland/deno:debian-2.1.4 AS builder -WORKDIR /app +WORKDIR /build COPY src ./src COPY templates ./templates @@ -18,6 +18,16 @@ COPY .env . COPY deno.json . COPY deno.lock . -ENTRYPOINT ["deno", "task", "start"] +RUN deno task compile + +FROM debian:bookworm-slim AS runner + +WORKDIR /app + +COPY --from=builder /build/voltaserve-idp ./voltaserve-idp +COPY --from=builder /build/.env ./.env +COPY --from=builder /build/templates ./templates + +ENTRYPOINT ["./voltaserve-idp"] EXPOSE 8081 diff --git a/idp/deno.json b/idp/deno.json index 05019284a..3aa1cc749 100644 --- a/idp/deno.json +++ b/idp/deno.json @@ -2,7 +2,7 @@ "tasks": { "start": "deno run --allow-read --allow-write --allow-env --allow-sys --allow-net src/app.ts", "dev": "deno run --allow-read --allow-write --allow-env --allow-sys --allow-net --reload src/app.ts", - "swagger": "deno run --allow-read --allow-write ./swagger.ts" + "compile": "deno compile --allow-read --allow-write --allow-env --allow-sys --allow-net --output voltaserve-idp src/app.ts" }, "imports": { "@/": "./src/", diff --git a/idp/qodana.yaml b/idp/qodana.yaml deleted file mode 100644 index cb1de6d2f..000000000 --- a/idp/qodana.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: '1.0' - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-js:latest diff --git a/language/qodana.yaml b/language/qodana.yaml deleted file mode 100644 index 84e3e499b..000000000 --- a/language/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-python:latest diff --git a/mosaic/.gitignore b/mosaic/.gitignore index 65112857f..2aa3591eb 100644 --- a/mosaic/.gitignore +++ b/mosaic/.gitignore @@ -1,5 +1 @@ /.env.local -/voltaserve -__debug_bin* -/*.tsv -/.air diff --git a/mosaic/Dockerfile b/mosaic/Dockerfile index bbca4bc6b..95992989d 100644 --- a/mosaic/Dockerfile +++ b/mosaic/Dockerfile @@ -12,7 +12,7 @@ FROM golang:1.22-alpine AS builder WORKDIR /build -COPY go.mod go.sum . +COPY go.mod go.sum ./ RUN go mod download @@ -20,7 +20,7 @@ COPY . . RUN go build -o voltaserve-mosaic -FROM golang:1.22-alpine AS runner +FROM alpine:3.21 AS runner WORKDIR /app diff --git a/mosaic/qodana.yaml b/mosaic/qodana.yaml deleted file mode 100644 index 215d80806..000000000 --- a/mosaic/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-go:latest diff --git a/ui/qodana.yaml b/ui/qodana.yaml deleted file mode 100644 index cb1de6d2f..000000000 --- a/ui/qodana.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: '1.0' - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-js:latest diff --git a/voltaserve.code-workspace b/voltaserve.code-workspace index 7445c12cb..ae9aceab5 100644 --- a/voltaserve.code-workspace +++ b/voltaserve.code-workspace @@ -27,6 +27,9 @@ { "path": "ui", }, + { + "path": ".github", + }, ], "settings": { "[dockerfile]": { diff --git a/webdav/.gitignore b/webdav/.gitignore index 65112857f..2aa3591eb 100644 --- a/webdav/.gitignore +++ b/webdav/.gitignore @@ -1,5 +1 @@ /.env.local -/voltaserve -__debug_bin* -/*.tsv -/.air diff --git a/webdav/Dockerfile b/webdav/Dockerfile index 19b287571..efbb4cd54 100644 --- a/webdav/Dockerfile +++ b/webdav/Dockerfile @@ -12,7 +12,7 @@ FROM golang:1.22-alpine AS builder WORKDIR /build -COPY go.mod go.sum . +COPY go.mod go.sum ./ RUN go mod download @@ -20,7 +20,7 @@ COPY . . RUN go build -o voltaserve-webdav -FROM golang:1.22-alpine AS runner +FROM alpine:3.21 AS runner WORKDIR /app diff --git a/webdav/qodana.yaml b/webdav/qodana.yaml deleted file mode 100644 index 215d80806..000000000 --- a/webdav/qodana.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -#exclude: -# - name: -# paths: -# - - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) - -#Specify Qodana linter for analysis (Applied in CI/CD pipeline) -linter: jetbrains/qodana-go:latest