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

Correctly Configured Dockerfile and Some Changes in development_settings file #328

Open
wants to merge 4 commits 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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please note we have a code of conduct, please follow it in all your interactions
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in all version.py files to the new version that this
Pull Request would represent. The versioning scheme (see next section)
4. Crate a Pull Request towards the "development" branch, ensure that your pull-request
4. Create a Pull Request towards the "development" branch, ensure that your pull-request
has at least 80% test-coverage and the Pull Request does not show issues in Travis
5. Once the Pull Request is reviewed it will be merged by one of the core developers

Expand Down
31 changes: 28 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
FROM python:3.6

ENV PYTHONUNBUFFERED=1


WORKDIR /app

# Intall dependencies
COPY /requirements/development_requirements.txt /app/
COPY /requirements/base_requirements.txt /app/

COPY . /app

RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
# Install dependencies
RUN pip install -r base_requirements.txt

# Install FOP 2.2
RUN wget https://storage.googleapis.com/server8koalixnet_backup/fop-2.2-bin.tar.gz
RUN tar -xzf fop-2.2-bin.tar.gz -C ../usr/bin
RUN ls
RUN rm -rf fop-2.2-bin.tar.gz
RUN chmod 755 /usr/bin/fop-2.2/fop/fop

# Install Java 8
RUN wget https://storage.googleapis.com/server8koalixnet_backup/jdk-8u181-linux-x64.tar.gz
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.development_settings

32 changes: 29 additions & 3 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
FROM python:3.6

ENV PYTHONUNBUFFERED=1


WORKDIR /app

# Intall dependencies
COPY /requirements/development_requirements.txt /app/
COPY /requirements/base_requirements.txt /app/

COPY . /app

RUN chmod +x /app/entrypoint.prod.sh
ENTRYPOINT ["/app/entrypoint.prod.sh"]
# Install dependencies
RUN pip install -r base_requirements.txt

# Install FOP 2.2
RUN wget https://storage.googleapis.com/server8koalixnet_backup/fop-2.2-bin.tar.gz
RUN tar -xzf fop-2.2-bin.tar.gz -C ../usr/bin
RUN ls
RUN rm -rf fop-2.2-bin.tar.gz
RUN chmod 755 /usr/bin/fop-2.2/fop/fop

# Install Java 8
RUN wget https://storage.googleapis.com/server8koalixnet_backup/jdk-8u181-linux-x64.tar.gz
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.development_settings

4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ services:
koalixcrm:
image: koalixswitzerland/koalixcrm:1.12.dev6
environment:
- DJANGO_SETTINGS_MODULE=projectsettings.settings.production_settings
- JAVA_HOME=/usr/bin/jdk1.8.0_162/jre
- DJANGO_SETTINGS_MODULE=projectsettings.settings.development_sqlite_settings
- JAVA_HOME=/usr/bin/jdk1.8.0_181/jre
ports:
- "8000:8000"
depends_on:
Expand Down
12 changes: 9 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
version: '2.0'
version: '3'

services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: postgres

koalixcrm:
build: .
environment:
- DJANGO_SETTINGS_MODULE=projectsettings.settings.development_settings
- JAVA_HOME=/usr/bin/jdk1.8.0_162/jre
- JAVA_HOME=/usr/bin/jdk1.8.0_181/jre
command: bash -c "python manage.py migrate --settings=projectsettings.settings.development_settings && python manage.py runserver 0.0.0.0:8000 --settings=projectsettings.settings.development_settings"
volumes:
- .:/app/
ports:
- "8000:8000"
depends_on:
depends_on:
- db
28 changes: 0 additions & 28 deletions entrypoint.prod.sh

This file was deleted.

28 changes: 0 additions & 28 deletions entrypoint.sh

This file was deleted.

3 changes: 2 additions & 1 deletion projectsettings/settings/development_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD':'postgres',
'HOST': 'db',
'PORT': 5432,
}
}

FOP_EXECUTABLE = "/usr/bin/fop"
FOP_EXECUTABLE = "/usr/bin/fop-2.2/fop/fop"
GRAPPELLI_INDEX_DASHBOARD = 'projectsettings.dashboard.CustomIndexDashboard'

KOALIXCRM_REST_API_AUTH = False
2 changes: 1 addition & 1 deletion projectsettings/settings/development_sqlite_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
}

FOP_EXECUTABLE = "C:/Users/ria/Downloads/fop-2.3/fop/fop.cmd"
FOP_EXECUTABLE = "/usr/bin/fop-2.2/fop/fop"
GRAPPELLI_INDEX_DASHBOARD = 'projectsettings.dashboard.CustomIndexDashboard'

KOALIXCRM_REST_API_AUTH = True
1 change: 1 addition & 0 deletions projectsettings/settings/production_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD':'postgres',
'HOST': 'db',
'PORT': 5432,
}
Expand Down