Docker_service/Dockerfile.adminfull

27 lines
751 B
Docker
Raw Normal View History

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 13:51:12 -03:00
RUN git clone "https://for_testing:glpat-mQEdGjBW9M1nDbCCuvzi@gitlab.com/m3f_usm/admin_transporte/frontend" /frontend
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
RUN apk update && apk add git
2024-01-31 13:51:12 -03:00
2024-01-31 21:47:14 -03:00
# Copia el directorio
2024-01-31 13:51:12 -03:00
WORKDIR /srv
2024-01-31 21:47:14 -03:00
RUN git clone "https://for_testing:glpat-mQEdGjBW9M1nDbCCuvzi@gitlab.com/m3f_usm/admin_transporte/backend" /srv
RUN rm -rf /srv/project/dist
2024-01-31 13:51:12 -03:00
RUN pip install -r requirements.txt
2024-01-31 21:47:14 -03:00
# Actualiza el contenido de frontend
COPY --from=frontend /frontend/dist/ /srv/project/dist
2024-01-31 13:51:12 -03:00
ENTRYPOINT ["python3"]
CMD [ "/srv/project/manage.py", "runserver", "0.0.0.0:4000" ]