forked from opensourcepos/opensourcepos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (47 loc) · 3.24 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (47 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM jekkos/opensourcepos:master
# --- Fix: supply the CI4 encryption starter key ---------------------------
# Docker drops env vars whose names contain a dot (encryption.key), so the
# app booted with an empty key and Customers/Sales (which use Mailchimp_lib
# -> Encryption) threw "Encrypter needs a starter key." Bake it into .env.
RUN sed -i "s|^encryption.key = .*|encryption.key = hex2bin:0c91d1cfdbbcc3aea3e2f4d871b5dfee1d2c4117e437d98f9cc1c2704ffc36ba|" /app/.env
# --- "Ocean Depths" rebrand ------------------------------------------------
# Ship the app theme as a standalone stylesheet and link it LAST in <head>
# with a version query, so a themed change is never masked by the browser
# caching OSPOS's fixed-hash ospos-<hash>.css filename.
COPY branding/ospos-theme.css /app/public/css/ospos-theme.css
RUN sed -i 's#</head># <link rel="stylesheet" href="css/ospos-theme.css?v=od2">\n</head>#' \
/app/app/Views/partial/header.php
# Login page keeps its own head; append the login skin to its stylesheet.
COPY branding/login-theme.css /tmp/login-theme.css
RUN cat /tmp/login-theme.css >> /app/public/css/login.css && rm -f /tmp/login-theme.css
# Revamped admin dashboard (analytics + all default module buttons).
COPY branding/home.php /app/app/Views/home/home.php
# Footer shown on every app page — attribution to the upstream project.
COPY branding/footer.php /app/app/Views/partial/footer.php
# --- Rebrand: "OSPOS" / "Open Source Point of Sale" -> "Silica POS" --------
# Only user-facing TEXT is changed. Language keys are lowercase (ospos_info,
# you_are_using_ospos) so a case-SENSITIVE replace touches values only.
# Code identifiers are intentionally left intact so nothing breaks:
# • the Config\OSPOS class and OSPOSRules validation class
# • the ospos_ database table prefix (every table + migration)
# • the ospos_session / csrf_ospos_v4 cookies, and css filenames
RUN find /app/app/Language -name '*.php' -type f -exec \
sed -i -e 's/Open Source Point of Sale/Silica POS/g' -e 's/OSPOS/Silica POS/g' {} + \
&& sed -i 's/OSPOS/Silica POS/g' /app/app/Views/partial/header.php \
&& sed -i 's/Open Source Point of Sale/Silica POS/g' \
/app/app/Database/Migrations/sqlscripts/initial_schema.sql
# --- Custom item columns pipeline -----------------------------------------
# One config file drives the DB, model, save controller, form and grid.
COPY customcols/columns.php /app/custom_columns.php
COPY customcols/custom_columns_helper.php /app/app/Helpers/custom_columns_helper.php
COPY customcols/custom_fields.php /app/app/Views/items/custom_fields.php
COPY customcols/sync_db.php /app/tools/sync_custom_columns.php
COPY customcols/apply.php /tmp/apply_custom_columns.php
COPY customcols/entrypoint.sh /usr/local/bin/custom-entrypoint.sh
# Autoload the helper, wire the source files, make the entrypoint executable.
RUN sed -i 's#public $helpers = \[#public $helpers = ['"'"'custom_columns'"'"',#' /app/app/Config/Autoload.php \
&& php /tmp/apply_custom_columns.php \
&& rm -f /tmp/apply_custom_columns.php \
&& chmod +x /usr/local/bin/custom-entrypoint.sh
# Run the DB column sync at startup, then the normal PHP/Apache boot.
ENTRYPOINT ["/usr/local/bin/custom-entrypoint.sh"]