local install
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syoul
2025-05-11 15:28:52 +02:00
parent 73c9ea26d2
commit e342d06fff
7 changed files with 49 additions and 10 deletions

View File

@@ -1,7 +1,8 @@
# .dockerignore
/.drone.yml
/.git*
/.nuxt
/.output
/.techradar
/docker
/node_modules
/.git*

BIN
docker/.Dockerfile.swp Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,13 +1,54 @@
ARG NODE_VERSION=24
FROM node:${NODE_VERSION} AS base
ARG UID=1000
ARG GID=1000
ENV UID=${UID}
ENV GID=${GID}
ENV USER=node
# If we provide a numeric UID
RUN if [ "${UID}" -eq "${UID}" ] 2>/dev/null; then \
# Force $UID of $USER if it exists
if [ "$(awk -F: '$1 == "'"${USER}"'" {print $3}' /etc/passwd)" != "${UID}" ]; then \
sed -i 's/^\('"${USER}"':x\):[0-9]\+:/\1:'"${UID}"':/' /etc/passwd; \
fi; \
# Create $USER if $UID does not exist
if [ "$(awk -F: '$3 == "'"${UID}"'" {print $1}' /etc/passwd)" = "" ]; then \
echo "${USER}:x:${UID}:${GID:-${UID}}::/home/${USER}:${SHELL:-/bin/sh}" >> /etc/passwd; \
echo "${USER}:\!:$(($(date +%s) / 60 / 60 / 24)):0:99999:7:::" >> /etc/shadow; \
mkdir -p /home/"${USER}"; \
fi; \
chown "${UID}" $(awk -F: '$1 == "'"${USER}"'" {print $(NF-1)}' /etc/passwd); \
fi
# If we provide a numeric GID
RUN if [ "${GID}" -eq "${GID}" ] 2>/dev/null; then \
# Force $GID of $GROUP if it already exists
if [ "$(awk -F: '$1 == "'"${GROUP}"'" {print $3}' /etc/group)" != "${GID}" ]; then \
sed -i 's/^\('"${GROUP}"':x\):[0-9]\+:/\1:'"${GID}"':/' /etc/group; \
fi; \
# Create $GROUP if $GID does not exist
if [ "$(awk -F: '$3 == "'"${GID}"'" {print $1}' /etc/group)" = "" ]; then \
echo "${GROUP}:x:${GID}:" >> /etc/group; \
fi; \
# Force $GID of $USER if it exists
if [ "$(awk -F: '$1 == "'"${USER}"'" {print $4}' /etc/passwd)" != "${GID}" ]; then \
sed -i 's/^\('"${USER}"':x:[0-9]\+\):[0-9]\+:/\1:'"${GID}"':/' /etc/passwd; \
fi; \
chgrp "${GID}" $(awk -F: '$1 == "'"${USER}"'" {print $(NF-1)}' /etc/passwd); \
fi
USER node
WORKDIR /app
EXPOSE 3000
VOLUME /app
FROM base AS build
COPY package.json package-lock.json ./
COPY --chown=$UID:$GID package.json package-lock.json ./
RUN npm install --include=dev
COPY ./ ./
COPY --chown=$UID:$GID ./ ./
ARG BASE_PATH=/
RUN sed -i 's|"basePath": "/"|"basePath": "'${BASE_PATH:-/}'"|' config.json
RUN sed -i 's|"basePath": "/"|"basePath": "'${BASE_PATH:-/}'"|' config.json
RUN npm run build
FROM build AS prod

View File

@@ -1,5 +1,3 @@
version: "3"
services:
radar:
labels:

View File

@@ -1,5 +1,3 @@
version: "3"
services:
radar:
ports:

View File

@@ -1,8 +1,9 @@
version: "3"
services:
radar:
build:
args:
- GID=${GID:-${UID:-1000}}
- UID=${UID:-1000}
context: ..
dockerfile: docker/Dockerfile
ports: