Commit bc387d8c authored by Ali Allaoui's avatar Ali Allaoui
Browse files
parents
*~
\ No newline at end of file
Docker files for Pasteque POS, using PostgreSQL as database engine
all users and passwords set to 'pasteque'
docker-compose 1.11 or superior required
To use in local, add 127.0.0.1 pasteque.docker to your /etc/hosts file. The hostname pasteque.docker can be changed in docker-compose.yml file by editing the VIRTUAL_HOST environment variable
\ No newline at end of file
FROM webdevops/php-apache:debian-8-php7
MAINTAINER ali.allaoui@gmail.com
RUN /usr/local/bin/apt-install php7.0-pgsql php7.0-mysql
RUN git clone https://aliallaoui@framagit.org/pasteque/pasteque-server.git
RUN ls
RUN ls pasteque-server
RUN rm /var/www/html/index.html
RUN cp -r pasteque-server/* /var/www/html
RUN rm -rf pasteque-server
RUN ls /var/www/html
COPY main-config.php /var/www/html/config.php
COPY db-config.php /var/www/html/core_modules/database/static/config.php
COPY ident-config.php /var/www/html/core_modules/ident/inifile/config.php
RUN mkdir /etc/pasteque
COPY pasteque_id.ini /etc/pasteque
\ No newline at end of file
<?php
// Pastèque Web back office, Static database module
//
// Copyright (C) 2013 Scil (http://scil.coop)
//
// This file is part of Pastèque.
//
// Pastèque is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pastèque is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pastèque. If not, see <http://www.gnu.org/licenses/>.
namespace StaticDB;
$config['type'] = "postgresql";
$config['host'] = "db_pasteque";
$config['port'] = 5432;
$config['name'] = "pasteque";
$config['user'] = "pasteque";
$config['password'] = "pasteque";
?>
<?php
// Pastèque Web back office
//
// Copyright (C) 2013 Scil (http://scil.coop)
//
// This file is part of Pastèque.
//
// Pastèque is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pastèque is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pastèque. If not, see <http://www.gnu.org/licenses/>.
// Base path to the directory containing all user's ini files.
// Either relative to the base directory of Pasteque (start with ./)
// or an absolute path.
// Each ini file is named <login>_id.ini, some special characters are
// replaced by 'underscore charcode underscore'
//
// Ini files contains:
// pwd_hash=<password hash>
$config['path'] = '/etc/pasteque';
<?php
// Pastèque Web back office, general configuration
//
// Copyright (C) 2013 Scil (http://scil.coop)
//
// This file is part of Pastèque.
//
// Pastèque is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pastèque is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pastèque. If not, see <http://www.gnu.org/licenses/>.
//////////////////
// Debug mode //
//////////////////
$config['debug'] = false;
// Uncomment to add an other log directory. System log is still enabled.
//$config['log_dir'] = "/var/log/pasteque";
// Log level: one of DEBUG, INFO, WARNING, ERROR
$config['log_level'] = 'WARNING';
//////////////////
// Core modules //
//////////////////
// Don't forget to set the configuration file in each module if it has one.
// The values must match a directory in the core module directory
// I.e. core_ident must match a directory under core_modules/ident/
$config['core_ident'] = 'inifile';
$config['core_database'] = 'static';
$config['core_modules'] = "static";
// Template
// Must match a directory in templates/
$config['template'] = 'pasteque-bootstrap';
// Thumbnail size in pixels
$config['thumb_width'] = 128;
$config['thumb_height'] = 128;
$config['thumb_quality'] = 50;
// JWT auth
$config['jwt_timeout'] = 600; // Validity in seconds of an auth token
$config['jwt_secret'] = 'pasteque';
// Paypal config (for module payment)
$config['pp_sandbox_id'] = '';
$config['pp_user_id'] = '';
$config['pp_email'] = '';
$config['pp_sandbox_email'] = '';
$config['pp_sandbox'] = true;
$config['pp_modules'] = [
array('module' => 'product_barcodes', 'price' => '1.00'),
];
$config['mandatory_modules'] = [
'base_products',
'base_sales',
'modules_management',
];
$config['free_modules'] = [
'base_restaurant',
'base_cashes',
'base_resources',
'base_stocks',
'base_users',
'product_compositions',
'product_discounts',
];
function getConfig() {
global $config;
return $config;
}
password = "$2y$10$3VasaP08C38y.Ah51LiDKOr7OQVthWa7OA7mzq03kKgPq6ng9CWnW"
\ No newline at end of file
#!/bin/bash
set -e
echo "Creating user $DB_USER with password $DB_USER_PASSWORD and database $DB_NAME with all privileges given to $DB_USER"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE ROLE $DB_USER WITH PASSWORD '$DB_USER_PASSWORD' ;
ALTER ROLE $DB_USER WITH LOGIN;
CREATE DATABASE $DB_NAME;
GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;
EOSQL
#!/bin/bash
set -e
psql $DB_NAME -v ON_ERROR_STOP=1 -U $DB_USER -f /tmp/create.sql
#!/bin/bash
set -e
psql $DB_NAME -v ON_ERROR_STOP=1 -U $DB_USER -f /tmp/data_france.sql
FROM postgres:alpine
MAINTAINER ali.allaoui@gmail.com
RUN apk -U upgrade && apk add git && apk add openssh-client
RUN git clone -n https://aliallaoui@framagit.org/pasteque/pasteque-server.git --depth 1
WORKDIR pasteque-server
RUN git checkout master install/database/postgresql/create.sql
RUN git checkout master install/database/postgresql/data_france.sql
RUN mv install/database/postgresql/*.sql /tmp
COPY 10-init-user-db.sh /docker-entrypoint-initdb.d/
COPY 20-create-tables.sh /docker-entrypoint-initdb.d/
COPY 30-load-data.sh /docker-entrypoint-initdb.d/
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
db_pasteque:
restart: always
build:
context: ./db_postgres
environment:
- DB_USER=pasteque
- DB_USER_PASSWORD=pasteque
- DB_NAME=pasteque
container_name: postgres_pasteque
volumes:
- postgres_data:/var/lib/postgresql/data
pasteque:
build:
context: ./apache-php
container_name: pasteque
environment:
- VIRTUAL_HOST=pasteque.docker
- WEB_DOCUMENT_ROOT=/var/www/html
- WEB_DOCUMENT_INDEX=index.php
depends_on:
- db_pasteque
links:
- db_pasteque:db_pasteque
volumes:
postgres_data:
driver: local
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment