Go to file
Francisco Sandoval be694dfa1e se modifica loggin de username a rut del usuario 2024-02-24 21:50:33 -03:00
app se modifica loggin de username a rut del usuario 2024-02-24 21:50:33 -03:00
project cambios en produccion 2023-12-05 17:02:53 -03:00
.gitignore commit inicial 2023-12-05 10:45:26 -03:00
manage.py commit inicial 2023-12-05 10:45:26 -03:00
readme.md cambios en produccion 2023-12-05 17:02:53 -03:00
requirements.txt commit inicial 2023-12-05 10:45:26 -03:00

readme.md

file: docker-compose.yml

version: '3'
name: paradero

services:

  backend:
    image: python:3.11-alpine
    environment:
      - PORT=4001
      - TRANSPORTE_API=https://transporte.hz.kursor.cl/api
      - TRANSPORTE_USER=usuario1
      - TRANSPORTE_PASS=usuario1
    ports:
      - 4001:4001
    working_dir: /proyecto
    volumes:
      - ./backend:/proyecto
      - venv:/root/venv
    command: sh -c "
      [ -d /root/venv/bin ] || ( \
          python -m venv /root/venv/ \
          && . /root/venv/bin/activate \
          && pip install -r requirements.txt \
      ) ;

      . /root/venv/bin/activate ;

      cd /proyecto ;
      [ -d project ] || django-admin startproject project ;
      [ -f .env ] || ( [ -f .env.develop ] && cp .env.develop .env ) ;
      chmod -R o+w . ;
      python manage.py runserver 0.0.0.0:$$PORT
      "

  frontend:
    image: node:18-alpine
    volumes:
      - ./frontend:/app
    environment:
      - PORT=3001
      - VITE_BACKEND=/api
    ports:
      - 3001:3001
    working_dir: /app
    command: sh -c "
      [ -d node_modules ] || (npm install --legacy-peer-deps) ;
      npm run dev
      "

volumes:
  venv: