2024-07-29 17:56:03 -04:00
|
|
|
# seccion frontend
|
|
|
|
FROM node:20-alpine as frontend
|
|
|
|
RUN apk update && apk add git
|
|
|
|
|
|
|
|
# Copia el proyecto
|
2024-08-05 09:24:15 -04:00
|
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/ilab_transporte_frontend /frontend
|
2024-07-30 13:17:06 -04:00
|
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/ilab_gestion_backend /backend
|
2024-07-29 17:56:03 -04:00
|
|
|
RUN rm -rf /backend/project/dist
|
|
|
|
|
|
|
|
# Compilar
|
|
|
|
WORKDIR /frontend
|
2024-08-05 09:55:39 -04:00
|
|
|
# RUN git checkout cc109373b359d20884bf5b258172c40dd0df6d23
|
2024-07-29 17:56:03 -04:00
|
|
|
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
|
2023-12-19 10:04:57 -03:00
|
|
|
|
2024-07-29 17:56:03 -04:00
|
|
|
RUN useradd -m app
|
2023-12-19 10:04:57 -03:00
|
|
|
|
|
|
|
WORKDIR /srv
|
|
|
|
|
2024-07-29 17:56:03 -04:00
|
|
|
# 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
|
|
|
|
|
2024-03-10 00:58:06 -03:00
|
|
|
RUN chown -R app:app /srv
|
|
|
|
USER app
|
2023-12-19 10:04:57 -03:00
|
|
|
|
|
|
|
ENTRYPOINT ["python3"]
|
2024-07-29 17:56:03 -04:00
|
|
|
CMD [ "/srv/project/manage.py", "runserver", "0.0.0.0:4000" ]
|