|
|
|
|
|
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
apt-get install -y curl build-essential git && \
|
|
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
|
|
apt-get install -y nodejs && \
|
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
|
|
ENV HOME=/home/user \
|
|
|
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
|
|
|
WORKDIR $HOME/app
|
|
|
|
|
|
|
|
|
COPY --chown=user requirements.txt $HOME/app/requirements.txt
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
COPY --chown=user . $HOME/app
|
|
|
|
|
|
|
|
|
WORKDIR $HOME/app/frontend
|
|
|
RUN npm install --legacy-peer-deps && npm run build
|
|
|
|
|
|
|
|
|
RUN mkdir -p $HOME/app/static && \
|
|
|
cp -r build/* $HOME/app/static/
|
|
|
|
|
|
|
|
|
WORKDIR $HOME/app
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y supervisor
|
|
|
|
|
|
|
|
|
RUN mkdir -p /etc/supervisor/conf.d
|
|
|
|
|
|
|
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
|
|
|
|
|
USER user
|
|
|
|
|
|
|
|
|
EXPOSE 7860 3000
|
|
|
|
|
|
|
|
|
ENV HOST=0.0.0.0
|
|
|
ENV PORT=3000
|
|
|
|
|
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
|
|