ci: docker_tag=ext - Migrate to Debian base with minimal packages
Some checks failed
Build and Push Docker image (ext) / docker (push) Failing after 59s
Some checks failed
Build and Push Docker image (ext) / docker (push) Failing after 59s
This commit is contained in:
parent
8c83757025
commit
34d57c95f7
36
Dockerfile
36
Dockerfile
@ -1,20 +1,26 @@
|
|||||||
# syntax=docker/dockerfile:1.4
|
# syntax=docker/dockerfile:1.4
|
||||||
|
|
||||||
FROM node:20-alpine
|
FROM debian:bookworm-slim
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Installation des dépendances minimales nécessaires
|
# Installation des dépendances minimales nécessaires
|
||||||
RUN apk update && apk upgrade && apk add --no-cache \
|
RUN apt-get update && apt-get upgrade -y && \
|
||||||
git \
|
apt-get install -y --fix-missing \
|
||||||
curl \
|
ca-certificates curl jq git && \
|
||||||
wget \
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
jq \
|
|
||||||
file \
|
# Installation de Node.js
|
||||||
netcat-openbsd \
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||||
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
apt-get install -y nodejs && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
# Création d'un utilisateur non-root
|
||||||
|
RUN useradd -m -u 1000 appuser && \
|
||||||
|
mkdir -p /app && chown -R appuser:appuser /app
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN chown -R appuser:appuser /app
|
||||||
|
|
||||||
# Ensure pkg directory exists and has correct permissions
|
# Ensure pkg directory exists and has correct permissions
|
||||||
RUN mkdir -p pkg && chmod -R 755 pkg
|
RUN mkdir -p pkg && chmod -R 755 pkg
|
||||||
@ -28,15 +34,9 @@ RUN ls -la pkg/ && file pkg/sdk_client_bg.wasm
|
|||||||
# so no compilation is required here.
|
# so no compilation is required here.
|
||||||
|
|
||||||
# Installation des dépendances Node.js
|
# Installation des dépendances Node.js
|
||||||
|
USER appuser
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copie de la configuration nginx
|
EXPOSE 3003
|
||||||
COPY nginx.dev.conf /etc/nginx/http.d/default.conf
|
|
||||||
|
|
||||||
# Script de démarrage
|
CMD ["npm", "start"]
|
||||||
COPY start-dev.sh /start-dev.sh
|
|
||||||
RUN chmod +x /start-dev.sh
|
|
||||||
|
|
||||||
EXPOSE 3003 80
|
|
||||||
|
|
||||||
CMD ["/start-dev.sh"]
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user