2024-01-31 13:51:12 -03:00
|
|
|
# seccion frontend
|
|
|
|
FROM node:20-alpine as frontend
|
|
|
|
RUN apk update && apk add git
|
2024-01-31 21:47:14 -03:00
|
|
|
|
|
|
|
# Copia el proyecto
|
2024-01-31 21:54:02 -03:00
|
|
|
# RUN git clone "https://for_testing:glpat-mQEdGjBW9M1nDbCCuvzi@gitlab.com/m3f_usm/admin_transporte/frontend" /frontend
|
|
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/admin_transporte_frontend /frontend
|
2024-01-31 22:03:33 -03:00
|
|
|
RUN git clone https://72d861f982d2a76275d5b8178fe0633b19c43d33@dev.ilab.cl/TDTP/admin_transporte_backend /backend
|
|
|
|
RUN rm -rf /backend/project/dist
|
2024-01-31 13:51:12 -03:00
|
|
|
|
2024-01-31 21:47:14 -03:00
|
|
|
# Compilar
|
2024-01-31 13:51:12 -03:00
|
|
|
WORKDIR /frontend
|
|
|
|
RUN npm install && npm run build
|
|
|
|
|
2024-01-31 21:47:14 -03:00
|
|
|
# Contenedor backend
|
2024-01-31 13:51:12 -03:00
|
|
|
FROM python:3.11-alpine
|
2024-01-31 21:47:14 -03:00
|
|
|
# Copia el directorio
|
2024-01-31 13:51:12 -03:00
|
|
|
WORKDIR /srv
|
2024-01-31 22:03:33 -03:00
|
|
|
|
|
|
|
# Actualiza el contenido
|
|
|
|
COPY --from=frontend /backend/requirements.txt /srv
|
2024-01-31 13:51:12 -03:00
|
|
|
RUN pip install -r requirements.txt
|
2024-01-31 21:47:14 -03:00
|
|
|
|
2024-01-31 22:03:33 -03:00
|
|
|
COPY --from=frontend /backend/readme.md /srv
|
2024-01-31 21:47:14 -03:00
|
|
|
COPY --from=frontend /frontend/dist/ /srv/project/dist
|
2024-01-31 22:03:33 -03:00
|
|
|
COPY --from=frontend /backend/project/ /srv/project
|
2024-01-31 21:47:14 -03:00
|
|
|
|
2024-01-31 13:51:12 -03:00
|
|
|
ENTRYPOINT ["python3"]
|
|
|
|
CMD [ "/srv/project/manage.py", "runserver", "0.0.0.0:4000" ]
|