diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d657a63..0ed8672 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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) diff --git a/Dockerfile b/Dockerfile index 3d2e06f..c21905d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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"] \ No newline at end of file +# Command to run the Django development server +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0783a1c --- /dev/null +++ b/docker-compose.yml @@ -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" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..625cc8c --- /dev/null +++ b/requirements.txt @@ -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