-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from ursais/bcb-add-frepple-eight
Add frePPLe version 8 support, using frePPLe's docker image as base
- Loading branch information
Showing
9 changed files
with
1,006 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
version: "2" | ||
services: | ||
frepple-db: | ||
image: ursa/postgresql:latest | ||
restart: always | ||
environment: | ||
- POSTGRES_DBNAME=postgres | ||
- POSTGRES_USER=frepple | ||
- POSTGRES_PASSWORD=frepple | ||
- POSTGRES_DATA=/var/lib/postgresql/data/pgdata | ||
volumes: | ||
- "postgres-data:/var/lib/postgresql/data" | ||
|
||
frepple-app: | ||
build: | ||
context: frepple | ||
ports: | ||
- "8080:80" | ||
depends_on: | ||
- frepple-db | ||
environment: | ||
- [email protected] | ||
- FREPPLE_ADMIN_NAME=Open Source Integrators | ||
- FREPPLE_SECRET_KEY=frepple-test | ||
- FREPPLE_OPTIONS={} | ||
- FREPPLE_CONN_MAX_AGE=60 | ||
- FREPPLE_TEST_NAME=test_frepple | ||
- FREPPLE_LOGDIR=/var/log/frepple | ||
- FREPPLE_SQL_ROLE=report_role | ||
#- FREPPLE_PORT_DEFAULT=127.0.0.1:8002 | ||
- FREPPLE_LANGUAGE_CODE=en | ||
- FREPPLE_GOOGLE_ANALYTICS=None | ||
- FREPPLE_TIME_ZONE=UTC | ||
- FREPPLE_SESSION_COOKIE_AGE=3600 * 24 * 3 | ||
- FREPPLE_ATTRIBUTES=[] | ||
- FREPPLE_MAXMEMORYSIZE=None | ||
- FREPPLE_MAXCPUTIME=None | ||
- FREPPLE_MAXTOTALLOGFILESIZE=200 | ||
- FREPPLE_DEFAULT_USER_GROUP=None | ||
- FREPPLE_DEFAULT_PAGESIZE=100 | ||
- FREPPLE_DEFAULT_THEME=earth | ||
#- FREPPLE_PORT=8000 | ||
# Apps | ||
- FREPPLE_INSTALLED_APPS_CUSTOM='freppledb.custom', | ||
- FREPPLE_INSTALLED_APPS_FORECASTING=true | ||
- FREPPLE_INSTALLED_APPS_INVENTORY=true | ||
- FREPPLE_INSTALLED_APPS_ODOO=true | ||
# PostgreSQL | ||
- POSTGRES_DBNAME=frepple | ||
- POSTGRES_HOST=frepple-db | ||
- POSTGRES_USER=frepple | ||
- POSTGRES_PASSWORD=frepple | ||
- FREPPLE_EMAIL_USE_TLS=True | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- FREPPLE_EMAIL_HOST_PASSWORD=test | ||
- FREPPLE_EMAIL_HOST='placeholder' | ||
#- FREPPLE_EMAIL_PORT=465 | ||
# Selenium | ||
- FREPPLE_SELENIUM_TESTS=chrome | ||
- FREPPLE_SELENIUM_HEADLESS=True | ||
# Odoo | ||
- FREPPLE_ODOO_PASSWORD_DEFAULT=test | ||
- FREPPLE_ODOO_PASSWORD_SCENARIO1=test | ||
- FREPPLE_ODOO_PASSWORD_SCENARIO2=test | ||
- FREPPLE_ODOO_PASSWORD_SCENARIO3=test | ||
- FREPPLE_CSRF_COOKIE_SAMESITE=None | ||
- FREPPLE_CSRF_COOKIE_SECURE=True | ||
- FREPPLE_SESSION_COOKIE_SAMESITE=None | ||
- FREPPLE_SESSION_COOKIE_SECURE=True | ||
|
||
|
||
volumes: | ||
postgres-data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#FROM 880063853698.dkr.ecr.us-west-2.amazonaws.com/strymon-frepple:frepple-8-0-3-official | ||
FROM ghcr.io/frepple/frepple-enterprise:8.0.3 | ||
MAINTAINER Open Source Integrators <[email protected]> | ||
|
||
|
||
# Update the PostgreSQL client to match the server | ||
ENV PGVERSION=14 | ||
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ | ||
&& curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | ||
&& apt update \ | ||
&& apt install --no-install-recommends -y postgresql-client-$PGVERSION \ | ||
&& rm -f /etc/apt/sources.list.d/pgdg.list \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Dockerize in order to use the djangosettings template | ||
ENV DOCKERIZE_VERSION v0.7.0 | ||
RUN apt-get update \ | ||
&& apt-get install -y wget \ | ||
&& wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin \ | ||
&& apt-get autoremove -yqq --purge wget && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install python and pip to install frePPLe requirements | ||
RUN apt-get install -y python3 | ||
RUN apt-get update && apt-get -y install python3-pip | ||
|
||
# Copy files | ||
COPY entrypoint.sh / | ||
COPY templates /frepple/templates | ||
COPY requirements.txt /frepple/requirements.txt | ||
COPY license.xml /etc/frepple/ | ||
|
||
# Install python3 modules | ||
RUN pip install -r /frepple/requirements.txt | ||
|
||
# Expose FrePPLe | ||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
name: frepple | ||
version: 1.0 | ||
appVersion: 8.0.3 | ||
description: FrePPLe 8 | ||
home: https://www.opensourceintegrators.com | ||
icon: https://github.com/ursais.png?width=64 | ||
keywords: | ||
- advanced planning system | ||
- manufacturing | ||
- purchasing | ||
- distribution | ||
- planning | ||
- material requirement | ||
sources: | ||
- https://github.com/ursais/docker | ||
maintainers: | ||
- name: Open Source Integrators | ||
email: [email protected] | ||
engine: gotpl |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: frepple | ||
adminName: frepple | ||
adminEmail: [email protected] | ||
secretKey: frepple | ||
secretWebtokenKey: frepple | ||
pgdatabase: frepple | ||
pghost: db | ||
pgpassword: frepple | ||
pguser: frepple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Set default value to environment variables | ||
export RUNNING_ENV="${RUNNING_ENV:='dev'}" | ||
|
||
# PostgreSQL | ||
export PGHOST="${POSTGRES_HOST:=db}" | ||
export PGPORT="${POSTGRES_PORT:=5432}" | ||
export PGUSER="${POSTGRES_USER:=frepple}" | ||
export PGPASSWORD="${POSTGRES_PASSWORD:=frepple}" | ||
export PGDATABASE="${POSTGRES_DBNAME:=false}" | ||
export DEFAULTDB="${DEFAULTDB:=postgres}" | ||
|
||
# Functions | ||
function config_frepple() { | ||
echo "Configure FrePPLe" | ||
dockerize -template $TEMPLATES/djangosettings.py.tmpl:/etc/frepple/djangosettings.py | ||
} | ||
|
||
# For dockerize | ||
export TEMPLATES=/frepple/templates | ||
config_frepple | ||
|
||
# Wait for database to be ready | ||
echo "Waiting for the database to be ready" | ||
retries=10 | ||
until pg_isready --timeout=1 "${params[@]}" >/dev/null 2>&1 | ||
do | ||
sleep 1 | ||
((retries=retries-1)) | ||
if [ $retries -eq 0 ] | ||
then | ||
echo "Can't connect to PostgreSQL on $POSTGRES_HOST:$POSTGRES_PORT as user ${POSTGRES_USER:-frepple}" | ||
exit 1 | ||
fi | ||
done | ||
echo "Connected to PostgreSQL on $POSTGRES_HOST:$POSTGRES_PORT as user ${POSTGRES_USER:-frepple}" | ||
|
||
# Create and migrate the databases | ||
frepplectl createdatabase --skip-if-exists | ||
frepplectl migrate --noinput | ||
|
||
# Configure Apache | ||
grep -qxF 'ServerName' /etc/apache2/apache2.conf || echo "ServerName localhost" >> /etc/apache2/apache2.conf | ||
rm -f /usr/local/apache2/logs/httpd.pid | ||
|
||
# Allow custom configuration steps to be added | ||
if [[ -d "/etc/frepple/entrypoint.d" ]]; then | ||
/bin/run-parts --verbose "/etc/frepple/entrypoint.d" | ||
fi | ||
|
||
#Start apache web server | ||
echo "Starting web server" | ||
exec apachectl -D FOREGROUND | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# placeholder for the frepple enterprise license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cheroot == 8.4.5 | ||
portend == 2.5 | ||
djangorestframework == 3.13.1 | ||
djangorestframework-bulk == 0.2.1 | ||
djangorestframework-filters == 0.10.2 | ||
django-bootstrap3 == 15.0.0 | ||
django-filter == 2.4.0 | ||
html5lib == 1.0.1 | ||
jdcal == 1.4.1 | ||
Markdown == 3.1.1 | ||
openpyxl == 3.0.9 | ||
lxml == 4.9.2 | ||
PyJWT == 2.4.0 | ||
urllib3 < 2 | ||
requests == 2.31.0 | ||
python-dateutil == 2.8.1 | ||
pillow >= 8.4.0 | ||
psutil == 5.7.3 | ||
psycopg2-binary == 2.8.6 | ||
# Python packaging is broken on ubuntu 20 for higher versions of setuptools | ||
setuptools <= 46.1 | ||
setuptools-rust == 0.12.1 | ||
pysftp == 0.2.9 | ||
channels == 4.0.0 | ||
attrs == 23.1.0 | ||
daphne == 4.0.0 | ||
Twisted[tls,http2] | ||
https://github.com/frePPLe/django/tarball/frepple_8.0 |
Oops, something went wrong.
8c58238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just peeking at your docker image :-)
Looks all cool and nice. A small remark: A separate requirements.txt is no longer needed on recent frepple versions (>7.0). The docker image and debian installer package all python dependencies already in a virtual env folder. We removed that burden from the installation.
Keeping it in your script isn't needed, but doesn't cause any harm either.