Skip to content

Commit

Permalink
created requirements.txt and docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
ria-htkw committed Mar 30, 2024
1 parent 5601c62 commit 7b7cbed
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
run: docker build . --file Dockerfile --tag koalixcrm-dev-container:$(date +%s)
25 changes: 7 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
FROM python:3.10

WORKDIR /app

# Intall dependencies
COPY /requirements/development_requirements.txt /app/
COPY /requirements/base_requirements.txt /app/
COPY . /app
WORKDIR /usr/src/app

# Install dependencies
RUN pip install -r base_requirements.txt
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt

# Install FOP 2.9
RUN wget https://storage.googleapis.com/server8koalixnet_backup/fop-2.9-bin.tar.gz
Expand All @@ -21,16 +17,9 @@ RUN wget https://storage.googleapis.com/server8koalixnet_backup/jdk-8u181-linux-
RUN tar -xzf jdk-8u181-linux-x64.tar.gz -C ../usr/bin
RUN rm -rf jdk-8u181-linux-x64.tar.gz

# Create /media/uploads/ directory which is required by django filebrowser
RUN mkdir -p projectsettings/media/uploads
RUN chmod -R 755 projectsettings/media

# Create /static/pdf for FOP PDF export
RUN mkdir -p projectsettings/static/pdf
RUN chmod -R 755 projectsettings/static/pdf

# Execute startup scripts
RUN python manage.py collectstatic --noinput --settings=projectsettings.settings.docker_development_settings
# Port to expose
EXPOSE 8000

RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
# Command to run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/usr/src/app
- ./data:/usr/src/app/data # Ensure this path matches where your SQLite DB is located
ports:
- "8000:8000"
14 changes: 14 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Django==3.2.20
django-filebrowser==3.14.3
lxml==5.1.0
olefile==0.46
Pillow==7.1.2
psycopg2-binary==2.8.4
pytz==2022.4
django-grappelli==2.15.7
djangorestframework==3.14.0
djangorestframework-xml==2.0.0
markdown==3.1.1
django-filter==23.5
pandas==1.5.3
matplotlib==3.7.5

0 comments on commit 7b7cbed

Please sign in to comment.