37 lines
1.0 KiB
Docker
37 lines
1.0 KiB
Docker
# seccion frontend
|
|
FROM node:20-alpine as frontend
|
|
RUN apk update && apk add git
|
|
|
|
# Copia el proyecto
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/admin_transporte_frontend /frontend
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/ilab_gestion_backend /backend
|
|
RUN rm -rf /backend/project/dist
|
|
|
|
# Compilar
|
|
WORKDIR /frontend
|
|
RUN git checkout cc109373b359d20884bf5b258172c40dd0df6d23
|
|
RUN npm install && npm run build
|
|
|
|
# Contenedor backend
|
|
FROM python:3.11-slim
|
|
|
|
RUN apt-get update && apt-get -y install git && apt-get clean
|
|
|
|
RUN useradd -m app
|
|
|
|
WORKDIR /srv
|
|
|
|
# Actualiza el contenido
|
|
COPY --from=frontend /backend/requirements.txt /srv
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY --from=frontend /backend/readme.md /srv
|
|
COPY --from=frontend /frontend/dist/ /srv/project/dist
|
|
COPY --from=frontend /backend/project/ /srv/project
|
|
|
|
RUN chown -R app:app /srv
|
|
USER app
|
|
|
|
ENTRYPOINT ["python3"]
|
|
CMD [ "/srv/project/manage.py", "runserver", "0.0.0.0:4000" ]
|