Go to file
Francisco Sandoval 798221981a commit inicial 2023-12-05 10:45:26 -03:00
app commit inicial 2023-12-05 10:45:26 -03:00
project commit inicial 2023-12-05 10:45:26 -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 commit inicial 2023-12-05 10:45:26 -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
      - DBNAME=/proyecto/db.sqlite3
    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=http://localhost:4001/rutaParadero
    ports:
      - 3001:3001
    working_dir: /app
    command: sh -c "
      [ -d node_modules ] || (npm install) ;
      npm run dev
      "

volumes:
  venv: