71 lines
1.5 KiB
Plaintext
71 lines
1.5 KiB
Plaintext
FROM node:20-bookworm
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
python3-dev \
|
|
gcc \
|
|
default-libmysqlclient-dev \
|
|
pkg-config \
|
|
git \
|
|
curl \
|
|
bash \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Environnement Python
|
|
RUN python3 -m venv /opt/venv
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
# Utilisateur Pterodactyl
|
|
RUN useradd -m -d /home/container -s /bin/bash container \
|
|
&& mkdir -p /home/container \
|
|
&& chown -R container:container /home/container
|
|
|
|
WORKDIR /home/container
|
|
|
|
# -------------------------
|
|
# Backend
|
|
# -------------------------
|
|
|
|
COPY backend/requirements.txt /tmp/requirements.txt
|
|
|
|
RUN pip install --no-cache-dir \
|
|
-r /tmp/requirements.txt
|
|
|
|
# -------------------------
|
|
# Frontend
|
|
# -------------------------
|
|
|
|
COPY frontend/package*.json /tmp/frontend/
|
|
|
|
WORKDIR /tmp/frontend
|
|
|
|
RUN npm ci
|
|
|
|
# -------------------------
|
|
# Application
|
|
# -------------------------
|
|
|
|
WORKDIR /home/container
|
|
|
|
COPY --chown=container:container backend /home/container/backend
|
|
COPY --chown=container:container frontend /home/container/frontend
|
|
|
|
# On remet les node_modules installés
|
|
RUN rm -rf /home/container/frontend/node_modules \
|
|
&& cp -a /tmp/frontend/node_modules /home/container/frontend/node_modules \
|
|
&& chown -R container:container /home/container
|
|
|
|
COPY --chown=container:container start.sh /home/container/start.sh
|
|
|
|
RUN chmod +x /home/container/start.sh
|
|
|
|
USER container
|
|
|
|
ENV USER=container
|
|
ENV HOME=/home/container
|
|
|
|
CMD ["/bin/bash", "/home/container/start.sh"] |