Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerised the project #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CollegeERP/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,8 @@
'rest_framework.authentication.SessionAuthentication',
),
}

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.7

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update
ENV PYTHONUNBUFFERED=1
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ python manage.py runserver

Then go to the browser and enter the url **http://127.0.0.1:8000/**

##Setup Using Docker

Ensure you have docker and docker-compose installed on your device.

Once you have installed, run the below command in the project directory.

docker-compose build && docker-compose up -d

Then you can access the ERP at **http://localhost:8000/**


## Login

Expand Down
Binary file modified db.sqlite3
Binary file not shown.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
django-server:
container_name: college-erp
restart: always
build: .
ports:
- 8000:8000
expose:
- 8000
volumes:
- college_erp_media_data:/usr/src/app/media
command: sh '/usr/src/app/run_web.sh'
18 changes: 18 additions & 0 deletions info/migrations/0017_alter_user_first_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.5 on 2023-09-05 06:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('info', '0016_auto_20210820_1553'),
]

operations = [
migrations.AlterField(
model_name='user',
name='first_name',
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
),
]
2 changes: 2 additions & 0 deletions run_web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
python manage.py collectstatic --noinput&&python manage.py migrate --noinput&&python manage.py runserver 0.0.0.0:8000