Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
f21c802
first commit to make project work with compose
iPegii Feb 2, 2026
8ed501f
refactor: fix Gemini CLI's weird quirks
iPegii Feb 2, 2026
de98aee
the pie is sorted so don't sorted it before render
iPegii Feb 2, 2026
7890460
add favicon
iPegii Feb 2, 2026
a854f64
fix crashing
iPegii Feb 2, 2026
61d94e5
update deploy-workflow poetry line
iPegii Feb 3, 2026
e7478db
fix poetry installs
iPegii Feb 3, 2026
dfff1ae
(frontend) use specific Node version and improve Dockerfile
iPegii Feb 3, 2026
e80ed57
revert the omitting of dev depedencies
iPegii Feb 3, 2026
547d6d2
test printing API_URL
iPegii Feb 3, 2026
55c7a0c
test fixing API env (try 2)
iPegii Feb 3, 2026
2d957e8
revert changes to API_URL
iPegii Feb 3, 2026
ac7d390
Improve API_URL debugging and test Dockerfile injecting of the ENVS
iPegii Feb 3, 2026
9195945
test using nginx-template with envsubst
iPegii Feb 3, 2026
ba154a5
switch to using express instead of nginx
iPegii Feb 3, 2026
13f9d5a
remove the other hashers
iPegii Feb 3, 2026
348f902
add timing debug for the express
iPegii Feb 3, 2026
444075f
add django Debug
iPegii Feb 3, 2026
e5517b6
explicitly name the the columns to fix runtime problem
iPegii Feb 3, 2026
8468bf5
improve setup for debug env
iPegii Feb 4, 2026
00059e5
Improve "/ykv" to remove unnecessary backend fetches and remove unuse…
iPegii Feb 4, 2026
fa43ad8
improve "/ykv" by not continuing with fetches if user has no permission
iPegii Feb 4, 2026
71ca40d
remove setSuccess and setError and use handleSnackbar instead to unif…
iPegii Feb 4, 2026
2e77e94
Change all backend calls to use the centralized axiosClient in axios.js
iPegii Feb 4, 2026
86bca90
move the use of backend to centralized api.ts
iPegii Feb 4, 2026
bbeea73
move the rest of fetches to usse the api.ts
iPegii Feb 4, 2026
8d7b441
remove random imports of API_URL
iPegii Feb 4, 2026
e6edb39
fix "omat tiedot" page to see the keys
iPegii Feb 4, 2026
314bc50
linting serializers and views.py
iPegii Feb 4, 2026
8e8af49
add jsconfig for intellisense
iPegii Feb 4, 2026
c3ec7ee
use user from ContextProvider to have consistent state
iPegii Feb 4, 2026
f832e27
remove test console.logs
iPegii Feb 4, 2026
ef20ad4
improve the privacy of users by not returning information to frontend…
iPegii Feb 4, 2026
17f00d6
update the Dockerfile to use production ready gunicorn
iPegii Feb 4, 2026
04bcbbd
add route for staticfiles to fix build
iPegii Feb 4, 2026
a8bca98
lint models.py
iPegii Feb 4, 2026
629920e
try fixing permission issues
iPegii Feb 4, 2026
85902d1
fix permission issues and test uvicorn
iPegii Feb 4, 2026
6e4c15b
test fix build
iPegii Feb 4, 2026
60ba94a
fix build try 2
iPegii Feb 4, 2026
baeea20
try fix build 3
iPegii Feb 4, 2026
e28425a
try fix build 4
iPegii Feb 4, 2026
d7b8062
use runserver so it works
iPegii Feb 4, 2026
8a52972
revert to last working version
iPegii Feb 4, 2026
d93a84e
try with gunicorn
iPegii Feb 4, 2026
2ebb071
Add also migrations
iPegii Feb 4, 2026
4848407
use the known working setup and do something later
iPegii Feb 4, 2026
155214f
give the Nginx a go
iPegii Feb 4, 2026
51d4197
fix frontend
iPegii Feb 5, 2026
bc0d5e4
test gunicorn backend v1
iPegii Feb 5, 2026
5f25003
add the missing entrypoint
iPegii Feb 5, 2026
efeff1f
gunicorn test 2 via example
iPegii Feb 5, 2026
2228239
fix python version
iPegii Feb 5, 2026
e5295a6
improve logging in prod
iPegii Feb 5, 2026
007386d
run poetry lock
iPegii Feb 6, 2026
92cbb5a
optimize the entrypoint to have minimal workers
iPegii Feb 6, 2026
4adabff
Try to fix the login issue
iPegii Feb 6, 2026
e888155
fix build and add better middleware logging
iPegii Feb 6, 2026
5262326
logging to check if password check is the culprid
iPegii Feb 6, 2026
7900e8c
test ASGI and Uvicorn now that it has been tested that it worked with…
iPegii Feb 6, 2026
e8de273
Improve UI and dev experience with hot reload
iPegii Feb 6, 2026
49eb7f1
adding our testing domain to CORS
iPegii Feb 6, 2026
4657606
fix path for cors
iPegii Feb 6, 2026
853b5ca
fix frontend build for prod
iPegii Feb 7, 2026
08cd705
try to fix frontend build v2
iPegii Feb 7, 2026
46a8914
add the prod route (for testing) to CORS
iPegii Feb 7, 2026
3a1b2e7
CORS fix two add prod application to allowed_hosts
iPegii Feb 7, 2026
a428957
add new cors allowed_host since we are using service to nginx
iPegii Feb 7, 2026
deadb4b
fix double '/api' in frontend
iPegii Feb 7, 2026
b3ade9a
fixing double /api v2
iPegii Feb 7, 2026
3e990e5
try fix cors v4
iPegii Feb 7, 2026
4d4dd58
Prod works before this. But testing to simplify axios.js
iPegii Feb 7, 2026
5d9e847
Fix: do not remove events if user is deleted.
iPegii Feb 7, 2026
0bde422
Improve the UI of the calendar
iPegii Feb 7, 2026
4e5bcc5
Add possibility to collapse the sidebar
iPegii Feb 7, 2026
2d98470
fix error when event doesn't have created_by
iPegii Feb 7, 2026
5db62bf
use Link instead of a in the logo to have smooth navigation
iPegii Feb 7, 2026
4b9b123
Move the collapse button after privacy for easier click
iPegii Feb 7, 2026
17dca22
Make sure django knows we are running pytest
iPegii Feb 7, 2026
c098788
fix UserUpdateSerializer so password can be updated
iPegii Feb 7, 2026
c9ba39e
improve readability of serializer.py
iPegii Feb 7, 2026
0ba1b1f
improve password change logic
iPegii Feb 7, 2026
ece7a4e
add test to check user can change password in python
iPegii Feb 7, 2026
632c1f4
fix all the frontend tests
iPegii Feb 7, 2026
2ee2465
fix the new api test for password changing
iPegii Feb 7, 2026
f2c56fc
Fix tests by adding i18n import globally to tests and adding missing …
iPegii Feb 7, 2026
f521e59
use relative route for context in all places
iPegii Feb 7, 2026
11ce6a6
use 'act' in tests where React state is activated to remove warnings
iPegii Feb 7, 2026
765f697
disable cypress tests from CI/CD for now
iPegii Feb 7, 2026
f747057
remove Express as unused
iPegii Feb 8, 2026
811f8e2
fix: showing users in ownpage
iPegii Feb 8, 2026
4ddaf72
Fix issues with pagination
iPegii Feb 8, 2026
e096341
fix: ownpage to show details of users when permissions high enough
iPegii Feb 8, 2026
ca86f87
updating user information and password to different tabs
iPegii Feb 8, 2026
0ab549f
fix username label overlapping in modify user dialog
iPegii Feb 8, 2026
4f85a18
use role enums instead of integers for clarity
iPegii Feb 8, 2026
b29dc16
Add tooltip to explain the permission levels
iPegii Feb 8, 2026
838418f
fix tests and make it possible to run them in parallel
iPegii Feb 8, 2026
cb77053
use English in code, move images to /public, fix use of enum in ownpage
iPegii Feb 8, 2026
bc66e3a
add tests for password changing
iPegii Feb 8, 2026
7e1f7ea
Remove dead code and move logic from ownpage to the child components
iPegii Feb 8, 2026
04c5707
implement feature to handle organization keyholders in one place
iPegii Feb 8, 2026
43cc6b6
add tests for OrganisationPage
iPegii Feb 8, 2026
367dac4
add scheduler back and use mock for recaptcha in backend tests so it …
iPegii Feb 8, 2026
f61b731
add django_scheduler back in settings.py also
iPegii Feb 8, 2026
d4045d7
add the frontend (test) url to allowed hosts
iPegii Feb 8, 2026
146d648
add chunking to frontend, improve dockerignore and use npm ci instead…
iPegii Feb 8, 2026
fa063a6
Add iCal
iPegii Feb 8, 2026
945c119
in reservations show snackbar instead of confirm screen when not logg…
iPegii Feb 8, 2026
b4b05e8
migrate ykv_resp created_by to use User foreign key
iPegii Feb 8, 2026
8b409db
remove chunking to check if it caused the crash
iPegii Feb 8, 2026
3387170
Fix mobile and add swipe to drawer
iPegii Feb 9, 2026
b64a70a
Fix showing event description
iPegii Feb 9, 2026
08b41b5
Fix redirect when access_token expires
iPegii Feb 9, 2026
8206932
Fix frontend tests broken by adding event description
iPegii Feb 9, 2026
064c520
refactor cleaningschedulepage to remove unused code
iPegii Feb 9, 2026
4831141
Fix bug in updating user details
iPegii Feb 9, 2026
400042a
Fix YKV
iPegii Feb 9, 2026
2068a1c
Improve ownpage tests and coverage
iPegii Feb 9, 2026
2e0c92c
Remove act to remove spam of warnings
iPegii Feb 9, 2026
8b8c1d8
add waitFor to handle the act() warning given
iPegii Feb 9, 2026
e2b046b
Fix window.location.reload() not implemented on test
iPegii Feb 9, 2026
e02a104
add window.location mock globally for tests
iPegii Feb 9, 2026
d10729e
Bug fixes for the YKV late logout feature + new test coverage
iPegii Feb 9, 2026
6b4f16c
Do not auto generate logout time when YKV resp is created
iPegii Feb 9, 2026
ee442f2
Move the styling out of the component to fix re-render issues with sc…
iPegii Feb 9, 2026
4cc1a4e
Instead of using naive datetime, use timezone aware times
iPegii Feb 9, 2026
a4518af
Fix get_queryset, which was broken by the timezone change
iPegii Feb 9, 2026
972732d
Start scheduler at the start
iPegii Feb 9, 2026
27cb1fa
Fix scheduler in prod and in dev
iPegii Feb 10, 2026
42415d0
remove manual tool for checking scheduler
iPegii Feb 10, 2026
c330b36
Fix tests and use DjangoStore for the scheduler
iPegii Feb 10, 2026
070afe1
Improve the security of the app
iPegii Feb 11, 2026
88e9fde
Protect XSS (use httpOnly cookie), add throttling to endpoints
iPegii Feb 12, 2026
a772cd7
add test-recaptcha key in github workflow
iPegii Feb 12, 2026
9141122
fix: workflow not using test settings
iPegii Feb 12, 2026
1b1d079
fix: crashing reservation for non logged-in user
iPegii Mar 1, 2026
a27ff97
fix: scrolling is not resetting to page switch
iPegii Mar 1, 2026
c89aee7
chore: update officers to current and improve headers
iPegii Mar 1, 2026
9b89981
feat: improve UI for the frontpage and have overall theme
iPegii Mar 2, 2026
92f2ae8
chore: fix momentjs localization. Improve frontpage
iPegii Mar 3, 2026
010a01a
feat: improve cards and remove the text "lisätietoa" from the cards.
iPegii Mar 3, 2026
5ef4314
feat: add filtering to reservationsView
iPegii Mar 3, 2026
2dcf6b6
fix: filter overflowing on mobile and make calendar usable looking on…
iPegii Mar 3, 2026
1149f8a
chore: try to not show user forbidden when they're not loggedin on pu…
iPegii Mar 3, 2026
175c56d
chore: disable fontsize change when sidebar item is active
iPegii Mar 3, 2026
4bccd20
fix: calendar filter showed console warnings for missing keys
iPegii Mar 3, 2026
0eb48b0
feat: treat user selecting no rooms in reservations as "all"
iPegii Mar 3, 2026
32c714e
feat: add smart'ish search to rules
iPegii Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Django Settings
DJANGO_SECRET_KEY=django-insecure-placeholder-change-this-in-production
DJANGO_DEBUG=False
# User credentials for first admin
DJANGO_DEFAULT_ADMIN_EMAIL=example@gmail.com
DJANGO_DEFAULT_ADMIN_USERNAME=admin
DJANGO_DEFAULT_ADMIN_PASSWORD=admin_password

# Database Settings (for Docker Compose and Django)
POSTGRES_DB=ilotalo
POSTGRES_USER=leppis
POSTGRES_PASSWORD=leppis_password
POSTGRES_HOST=db
POSTGRES_PORT=5432

# Mapping for existing settings.py logic
TEST_DB_NAME=ilotalo
TEST_DB_USER=leppis
TEST_DB_PASSWORD=leppis_password
TEST_DB_HOST=db
TEST_DB_PORT=5432

# Frontend Settings
SITE_KEY=your_site_key_placeholder
API_URL=http://api:8000 # Backend service URL for nginx proxy
144 changes: 144 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# AI Coding Agent Instructions for Klusteri Website

## Project Overview
This is a full-stack web application for managing a student housing association (Klusteri). It handles reservations, cleaning schedules, night watch responsibilities, defect reporting, and organization management.

**Tech Stack:**
- Backend: Django REST Framework with PostgreSQL
- Frontend: React with Vite, Material-UI, Axios
- Testing: pytest (backend), Jest + Cypress (frontend)
- Deployment: Docker Compose
- Auth: JWT tokens

## Architecture Patterns

### API Structure
- Base URL: `/api/`
- Authentication: `/api/token/` (obtain), `/api/token/refresh/`
- Resources follow REST conventions:
- List: `GET /api/listobjects/{resource}/`
- Create: `POST /api/{resource}/create_{resource}`
- Update: `PUT /api/{resource}/update_{resource}/{id}/`
- Delete: `DELETE /api/{resource}/delete_{resource}/{id}/`

### Data Models
- **User**: Custom model with roles (1-5), keys access, reservation rights
- **Organization**: Student organizations with email, homepage, color
- **Event**: Reservations with start/end, room, organizer (FK to Organization)
- **NightResponsibility**: YKV (night watch) shifts with login/logout tracking
- **DefectFault**: Maintenance issues with repair tracking
- **Cleaning**: Weekly cleaning assignments between organizations
- **CleaningSupplies**: Inventory of cleaning tools

### Frontend Organization
- Components in `src/components/` - reusable UI elements
- Pages in `src/pages/` - route-based components
- API calls centralized in `src/api/api.ts`
- State management via Context Provider (`src/context/ContextProvider.jsx`)
- Internationalization with react-i18next

## Development Workflows

### Backend Setup
```bash
cd backend
poetry install
poetry shell
python manage.py migrate
python manage.py runserver # Development only
# For production: gunicorn backend.wsgi:application --bind 0.0.0.0:8000
```

### Frontend Setup
```bash
cd frontend
npm install
npm run dev
```

### Testing
- Backend: `cd backend && poetry run pytest`
- Frontend unit: `cd frontend && npm test`
- E2E: `cd frontend && npx cypress open`
- Coverage: `poetry run coverage run --branch -m pytest && coverage report`

### Backend Testing Tips
- **Run in Docker**: If local environment setup is complex, run tests inside the container:
```bash
docker exec ilotalo-new-api-1 pytest tests/test_views.py -n auto
```
- **Test Settings**: Pytest uses `backend/test_settings.py` (via `pytest.ini`). This enables `TESTING = True`.
- **Database**: Django's `TestCase` automatically handles database creation/tear-down and wraps tests in transactions.
- **Mocking**: Use `unittest.mock.patch` for external APIs (like reCAPTCHA) or signals.
- **iCal Testing**: Use the `icalendar` library to parse and verify `.ics` responses.
- **Model Creation**: Ensure all required fields are provided. E.g., `User.objects.create_user` requires `username`, `email`, `password`, `telegram`, and `role`.
- **Signal Testing**: When testing `AppConfig.ready()`, remember it's called once at startup. Use fresh instances or patch `sys.argv`/modules to simulate different environments.

### Docker Development
```bash
docker-compose -f docker-compose-dev.yml up --build
```

### Docker Production
```bash
docker-compose -f docker-compose-prod.yml up --build
```

## Code Conventions

### Backend
- Use Poetry for dependency management (not pip)
- Models inherit from Django's base classes
- Views extend DRF's APIView or generics
- Database: PostgreSQL in prod/dev, conditional logic in settings.py
- Scheduler: django-apscheduler for automated tasks

### Frontend
- JSX files with .jsx extension
- Axios instance configured in `src/axios.js`
- Material-UI components with Emotion styling
- Translation keys in `src/translations.json`
- Environment variables prefixed with `VITE_` for client-side access

### Common Patterns
- Error handling: Try/catch in async functions, display user-friendly messages
- Loading states: Use React state for API call status
- Form validation: Client-side with required fields, server-side in DRF serializers
- Authentication: Check JWT token presence, redirect to login on 401
- Permissions: Role-based access (1=admin, 2-5=user levels)

## Key Files to Reference

### Backend
- `backend/settings.py`: Environment-based config, database switching
- `ilotalo/models.py`: Core data models and relationships
- `ilotalo/views.py`: API endpoints implementation
- `ilotalo/urls.py`: URL routing patterns

### Frontend
- `src/api/api.ts`: Centralized API calls
- `src/App.jsx`: Main routing and navigation
- `src/context/ContextProvider.jsx`: Global state management
- `src/components/`: Reusable components (e.g., LoginForm, ReservationsView)

### Configuration
- `docker-compose-dev.yml`: Development environment (uses `Dockerfile.dev`)
- `docker-compose-prod.yml`: Production environment (uses `Dockerfile`)
- `pyproject.toml`: Backend dependencies
- `frontend/package.json`: Frontend scripts and deps

## Gotchas
- Database migrations required after model changes: `python manage.py makemigrations`
- Environment variables loaded via python-dotenv in settings.py
- CORS enabled for frontend-backend communication
- Finnish UI text, English code comments
- Test database isolation using CYPRESS env var
- Scheduler jobs defined in `scheduler/scheduler.py`

## Production

In openshift

Runs through the Dockerfiles, docker composes are not used in production.

**Production Dockerfile**: `backend/Dockerfile` - Multi-stage build with Gunicorn WSGI server, optimized for production with proper security practices and health checks.
43 changes: 25 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install dependencies
run: |
cd backend
poetry install
poetry install --no-root
cd ../frontend
npm install

Expand Down Expand Up @@ -65,31 +65,38 @@ jobs:
poetry run coverage xml -o coverage.xml

- name: Run frontend tests
if: success() || failure()
working-directory: ./frontend
run: npm run test

- name: Create frontend coverage report
working-directory: ./frontend
run: npx jest --coverage
# Cypress tests are disabled for now
# - name: Start backend
# run: |
# cd backend
# poetry run python manage.py runserver &

#Cypress tests require backend to be running
- name: Start backend
run: |
cd backend
poetry run python manage.py runserver &

- name: Run Cypress tests
uses: cypress-io/github-action@v3
with:
working-directory: ./frontend
project: ./
browser: chrome
build: npm run build
start: npm run dev
# - name: Run Cypress tests
# uses: cypress-io/github-action@v3
# with:
# working-directory: ./frontend
# project: ./
# browser: chrome
# build: npm run build
# start: npm run dev

- name: Upload coverage reports to Codecov
if: always()
uses: codecov/codecov-action@v3
with:
files: ./backend/coverage.xml,./frontend/coverage/clover.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload Test Coverage Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
backend/coverage.xml
frontend/coverage/
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ __pycache__
.coverage
htmlcov
.env
backend/ilotalo/migrations/*
!backend/ilotalo/migrations/__init__
siivousvuorot.json
siivousvuorot.json
SECURITY_AUDIT.md
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Dokumentaatiot

### Tekniset dokumentit
- [Roolipohjaisen Pääsynhallinnan Dokumentaatio](docs/ROLE_PERMISSIONS.md) - Käyttäjäroolit ja oikeudet

### Sprint dokumentaatio
- [Product Backlog](https://github.com/orgs/matlury/projects/1)
- [Sprint 0 Task Board](https://github.com/orgs/matlury/projects/18)
- [Sprint 1 Task Board](https://github.com/orgs/matlury/projects/20)
Expand Down Expand Up @@ -78,6 +82,10 @@ Testit voi ajaa myös pytestin avulla
```bash
poetry run coverage run --branch -m pytest
```
Testit voi ajaa myös rinnakkain
```bash
pytest -n auto
```
Tällöin testikattavuusraportin saa tulostettua konsoliin komennolla
```
coverage report
Expand Down
19 changes: 18 additions & 1 deletion backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
.env
.env
__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
.coverage
htmlcov/
.venv/
venv/
ENV/
.git/
.github/
.vscode/
.idea/
*.log
db.sqlite3
.python-version
# poetry.lock and pyproject.toml are needed for dependencies
57 changes: 49 additions & 8 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
# Stage 1: Builder stage
FROM python:3.10.13-bullseye AS builder

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true

WORKDIR /app

# Install Poetry
RUN pip install poetry

# Configure Poetry
RUN poetry config virtualenvs.create false

# Copy dependency files
COPY pyproject.toml poetry.lock ./

# Install dependencies (without dev dependencies)
RUN poetry install --without dev --no-root

# Stage 2: Production stage
FROM python:3.10.13-bullseye

ENV POETRY_VIRTUALENVS_IN_PROJECT=true
# Create non-root user for OpenShift compatibility
RUN useradd -m -r appuser && \
mkdir /app && \
chown -R appuser /app

WORKDIR /backend
# Copy Python packages from builder stage
COPY --from=builder /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
COPY --from=builder /usr/local/bin/ /usr/local/bin/

COPY . .
# Set the working directory
WORKDIR /app

RUN chmod -R 777 *
# Copy application code with proper ownership
COPY --chown=appuser:appuser . .

RUN pip install poetry
# Make entrypoint script executable (before switching user)
RUN chmod +x /app/entrypoint.sh

RUN poetry config virtualenvs.create false
# OpenShift Permission Fix:
# Ensure the directory is owned by the root group for OpenShift random UIDs
RUN chgrp -R 0 /app && \
chmod -R g=u /app

# Set environment variables to optimize Python
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1

RUN poetry install --no-dev
# Switch to non-root user
USER appuser

# Expose the application port
EXPOSE 8000

CMD ["/bin/bash", "-c", "python manage.py makemigrations;python manage.py migrate;python manage.py runserver 0.0.0.0:8000"]
# Use entrypoint script to run migrations and start gunicorn
ENTRYPOINT ["/app/entrypoint.sh"]
19 changes: 19 additions & 0 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.10.13-bullseye

ENV POETRY_VIRTUALENVS_IN_PROJECT=true

WORKDIR /backend

COPY . .

RUN chmod -R 777 *

RUN pip install poetry

RUN poetry config virtualenvs.create false
# --without dev
RUN poetry install --no-root

EXPOSE 8000

CMD ["/bin/bash", "-c", "python manage.py makemigrations;python manage.py migrate;python manage.py runserver 0.0.0.0:8000"]
Loading
Loading