Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acad4b4a87 | ||
|
|
2ea54e9e71 | ||
|
|
99ae558713 | ||
|
|
9c0032d5ff | ||
|
|
1eb55a9cfa | ||
|
|
dae3363f45 | ||
|
|
eec088db25 | ||
|
|
1deaec32a4 | ||
|
|
52f9d41b1e | ||
|
|
c156ec15fb | ||
|
|
4f3d723489 | ||
|
|
2eaed5d1d0 | ||
|
|
bb45793fbe | ||
|
|
e75a2763bf | ||
|
|
175191f689 | ||
|
|
d36927e421 | ||
|
|
eef9b31197 | ||
|
|
da98232181 | ||
|
|
26aba7fda3 | ||
|
|
d5fca63168 | ||
|
|
8ff2bb62d1 | ||
|
|
a0caac22d0 | ||
|
|
09e221c100 | ||
|
|
04c5d352b4 | ||
|
|
540479ff53 | ||
|
|
6c08335fea | ||
|
|
01ab1eaa56 | ||
|
|
cfd2409cc9 | ||
|
|
67a530d5c5 | ||
|
|
ed07a702d0 | ||
|
|
013d8831a1 | ||
|
|
ffe484690e | ||
|
|
d8aff21b20 | ||
|
|
77cb630320 | ||
|
|
42775f4fd8 | ||
|
|
63de0a32bb | ||
|
|
2d66c4d94f | ||
|
|
2615215bd9 |
@@ -0,0 +1,2 @@
|
||||
# Legacy naming convention for docker containers
|
||||
COMPOSE_COMPATIBILITY=true
|
||||
@@ -3,3 +3,5 @@
|
||||
**/*tar.gz
|
||||
**/*.pgdump
|
||||
**/*.swp
|
||||
**/*.out
|
||||
**/*.txt
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
[](https://gitter.im/metasfresh/metasfresh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## About this repository: ##
|
||||
This repository contains all necessary files in order to create metasfresh in a docker environment.
|
||||
|
||||
@@ -8,18 +6,18 @@ Additionally you will find the source files for modifying the core images in cas
|
||||
## Installation: ##
|
||||
In order to install metasfresh in a docker environment you're free to follow this guide:
|
||||
|
||||
[Install metasfresh on Docker](http://docs.metasfresh.org/installation_collection/EN/How_do_I_setup_the_metasfresh_stack_using_Docker.html)
|
||||
[Install metasfresh on Docker](https://docs.metasfresh.org/installation_collection/EN/How_do_I_setup_the_metasfresh_stack_using_Docker.html)
|
||||
|
||||
[Install metasfresh on Docker - SSL](http://docs.metasfresh.org/installation_collection/EN/How_do_I_setup_metasfresh_docker_with_ssl.html)
|
||||
[Install metasfresh on Docker - SSL](https://docs.metasfresh.org/installation_collection/EN/How_do_I_setup_metasfresh_docker_with_ssl.html)
|
||||
## Guides: ##
|
||||
|
||||
* [Create a database backup](http://docs.metasfresh.org/howto_collection/EN/How_do_I_backup_metasfresh_docker.html)
|
||||
* [Create a database backup](https://docs.metasfresh.org/installation_collection/EN/How_do_I_backup_metasfresh_docker.html)
|
||||
|
||||
* [Update your metasfresh-docker installation](http://docs.metasfresh.org/howto_collection/EN/How_do_I_update_metasfresh_using_Docker.html)
|
||||
* [Update your metasfresh-docker installation](https://docs.metasfresh.org/howto_collection/EN/How_do_I_update_metasfresh_using_Docker.html)
|
||||
|
||||
* [Use the Java Swing Client with metasfresh-docker](http://docs.metasfresh.org/howto_collection/EN/How_do_I_use_Java_Client_using_Docker.html)
|
||||
* [Use the Java Swing Client with metasfresh-docker](https://docs.metasfresh.org/howto_collection/EN/How_do_I_use_Java_Client_using_Docker.html)
|
||||
|
||||
* [Run multiple metasfresh-docker stacks / Change webui ports](http://docs.metasfresh.org/installation_collection/EN/How_do_I_change_the_webui_ports_for_metasfresh_docker.html)
|
||||
* [Run multiple metasfresh-docker stacks / Change webui ports](https://docs.metasfresh.org/installation_collection/EN/How_do_I_change_the_webui_ports_for_metasfresh_docker.html)
|
||||
|
||||
## Frequent Questions: ##
|
||||
* **Q: Where are the database files located at?**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
FROM metasfresh/metasfresh-app:5.173
|
||||
ARG BASE_REGISTRY=metasfresh
|
||||
FROM $BASE_REGISTRY/metasfresh-app:5.175
|
||||
|
||||
COPY sources/configs/* /opt/metasfresh/
|
||||
COPY sources/start_app.sh /opt/metasfresh/
|
||||
|
||||
@@ -27,6 +27,11 @@ spring.rabbitmq.port=5672
|
||||
spring.rabbitmq.username=metasfresh
|
||||
spring.rabbitmq.password=metasfresh
|
||||
|
||||
spring.rabbitmq.listener.direct.consumers-per-queue=1
|
||||
spring.rabbitmq.listener.direct.prefetch=1
|
||||
spring.rabbitmq.listener.simple.max-concurrency=1
|
||||
spring.rabbitmq.listener.simple.prefetch=1
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# Elasticsearch
|
||||
# for more properties, see https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchProperties.java
|
||||
@@ -34,3 +39,4 @@ spring.rabbitmq.password=metasfresh
|
||||
# Elasticsearch cluster name.
|
||||
spring.data.elasticsearch.cluster-name=metasfresh
|
||||
spring.data.elasticsearch.cluster-nodes=search:9300
|
||||
spring.data.elasticsearch.client.reactive.endpoints=search:9200
|
||||
|
||||
@@ -10,7 +10,6 @@ PID_FOLDER=/opt/metasfresh
|
||||
|
||||
JAVA_OPTS="\
|
||||
-Xmx1024M\
|
||||
-XX:MaxPermSize=512M\
|
||||
-XX:+HeapDumpOnOutOfMemoryError\
|
||||
-DPropertyFile=/opt/metasfresh/metasfresh.properties\
|
||||
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8788\
|
||||
|
||||
@@ -45,6 +45,13 @@ run_db_update()
|
||||
cd /opt/metasfresh/dist/install/ && java -jar ./lib/de.metas.migration.cli.jar $@
|
||||
}
|
||||
|
||||
# For Instances with Java8. Should have no effect on other java versions due to absolute paths used.
|
||||
# Need to remove this file or we get "java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper" when running jasper reports
|
||||
remove_accessibility-properties(){
|
||||
rm -fv /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/accessibility.properties
|
||||
rm -fv /etc/java-8-openjdk/accessibility.properties
|
||||
}
|
||||
|
||||
run_metasfresh()
|
||||
{
|
||||
|
||||
@@ -53,12 +60,21 @@ run_metasfresh()
|
||||
# info: https://docs.oracle.com/cd/E26362_01/E40761/html/known-bugs-issues.html
|
||||
# https://stackoverflow.com/a/19379760
|
||||
|
||||
#2019-01-29 jb: added '-XX:HeapDumpPath=/opt/metasfresh/heapdump' to java opts
|
||||
# gh issue: https://github.com/metasfresh/metasfresh-docker/issues/41
|
||||
|
||||
#2022-04-23 ts: added '-Dloader.path=/opt/metasfresh/external-lib':
|
||||
# Allow loading jars from /opt/metasfresh/external-lib.
|
||||
# This assumes that the app uses PropertiesLauncher (can be verified by opening the jar e.g. with 7-zip and checking META-INF/MANIFEST.MF)
|
||||
# Also see https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#executable-jar-property-launcher-features
|
||||
|
||||
cd /opt/metasfresh/ && java \
|
||||
-Dsun.misc.URLClassPath.disableJarChecking=true \
|
||||
-Xmx1024M -XX:MaxPermSize=512M \
|
||||
-Xmx1024M \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh/heapdump \
|
||||
-DPropertyFile=/opt/metasfresh/metasfresh.properties \
|
||||
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8788 \
|
||||
-Dloader.path=/opt/metasfresh/external-lib \
|
||||
-Dcom.sun.net.ssl.enableECC=false \
|
||||
-jar metasfresh_server.jar
|
||||
}
|
||||
@@ -73,6 +89,8 @@ wait_dbms
|
||||
|
||||
run_db_update
|
||||
|
||||
remove_accessibility-properties
|
||||
|
||||
run_metasfresh
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
FROM metasfresh/metasfresh-db:5.173
|
||||
ARG BASE_REGISTRY=metasfresh
|
||||
FROM $BASE_REGISTRY/metasfresh-db:5.175
|
||||
|
||||
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
|
||||
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
@@ -7,6 +8,6 @@ ENV LANG=de_DE.UTF-8
|
||||
ENV LANGUAGE=en_US.UTF-8
|
||||
ENV LC_MESSAGES=en_US.UTF-8
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["postgres"]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
db:
|
||||
build: db
|
||||
shm_size: 256m
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/db/data:/var/lib/postgresql/data
|
||||
@@ -21,12 +22,12 @@ app:
|
||||
- search:search
|
||||
expose:
|
||||
- "8282"
|
||||
- "61616"
|
||||
- "8788"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/app/log:/opt/metasfresh/log:rw
|
||||
- ./volumes/app/heapdump:/opt/metasfresh/heapdump:rw
|
||||
- ./volumes/app/external-lib:/opt/metasfresh/external-lib:rw
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
version: '3'
|
||||
services:
|
||||
db:
|
||||
build: db
|
||||
shm_size: 256m
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/db/data:/var/lib/postgresql/data
|
||||
- ./volumes/db/log:/var/log/postgresql
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
- METASFRESH_USERNAME=metasfresh
|
||||
- METASFRESH_PASSWORD=metasfresh
|
||||
- METASFRESH_DBNAME=metasfresh
|
||||
- DB_SYSPASS=System
|
||||
- POSTGRES_PASSWORD=ip2LmNzXX8p8iXg9lZTWEJ9524kQDbXFudB7LR03T-xK9fLweX3TLMkA2AYcEiaS
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
app:
|
||||
build: app
|
||||
hostname: app
|
||||
links:
|
||||
- db:db
|
||||
- rabbitmq:rabbitmq
|
||||
- search:search
|
||||
expose:
|
||||
- "8282"
|
||||
- "8788"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/app/log:/opt/metasfresh/log:rw
|
||||
- ./volumes/app/heapdump:/opt/metasfresh/heapdump:rw
|
||||
- ./volumes/app/external-lib:/opt/metasfresh/external-lib:rw
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
- METASFRESH_HOME=/opt/metasfresh
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
webapi:
|
||||
build: webapi
|
||||
links:
|
||||
- app:app
|
||||
- db:db
|
||||
- rabbitmq:rabbitmq
|
||||
- search:search
|
||||
expose:
|
||||
- "8789"
|
||||
# to access the webui-api directly
|
||||
# (eg. for debugging or connecting your app to the metasfresh api)
|
||||
# uncomment following port:
|
||||
#ports:
|
||||
#- "8080:8080"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/webapi/log:/opt/metasfresh-webui-api/log:rw
|
||||
- ./volumes/webapi/heapdump:/opt/metasfresh-webui-api/heapdump:rw
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
webui:
|
||||
build: webui
|
||||
links:
|
||||
- webapi:webapi
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
restart: always
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
#uncomment and set to URL where metasfresh will be available from browsers
|
||||
#environment:
|
||||
#- WEBAPI_URL=http://example.com:8080
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
rabbitmq:
|
||||
build: rabbitmq
|
||||
expose:
|
||||
- "5672"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volumes/rabbitmq/log:/var/log/rabbitmq/log
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
RABBITMQ_DEFAULT_USER: "metasfresh"
|
||||
RABBITMQ_DEFAULT_PASS: "metasfresh"
|
||||
RABBITMQ_DEFAULT_VHOST: "/"
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
search:
|
||||
build: search
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
cap_add:
|
||||
- IPC_LOCK
|
||||
# to access the search api directly
|
||||
# (e.g. if you did docker-compose up search to have the deachboard with your locally running metasfresh services)
|
||||
# uncomment following ports:
|
||||
# ports:
|
||||
# - "9200:9200"
|
||||
# - "9300:9300"
|
||||
volumes:
|
||||
- ./volumes/search/data:/usr/share/elasticsearch/data
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
- "ES_JAVA_OPTS=-Xms128M -Xmx256m"
|
||||
restart: always
|
||||
logging:
|
||||
options:
|
||||
max-size: '30m'
|
||||
max-file: '3'
|
||||
driver: json-file
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:16.04
|
||||
FROM ubuntu:20.04
|
||||
|
||||
|
||||
RUN apt update && apt -y full-upgrade
|
||||
@@ -7,12 +7,12 @@ RUN apt autoclean && apt update
|
||||
RUN apt -y install netcat \
|
||||
&& apt -y install curl \
|
||||
&& apt -y install openjdk-8-jdk-headless \
|
||||
&& apt -y install postgresql-client-9.5 \
|
||||
&& apt -y install postgresql-client-12 \
|
||||
&& apt -y autoremove \
|
||||
&& apt -y autoclean
|
||||
|
||||
RUN mkdir -p /opt/metasfresh
|
||||
RUN curl https://repo.metasfresh.com/repository/mvn-release-releases/de/metas/dist/metasfresh-dist-dist/5.173.2-389+release/metasfresh-dist-dist-5.173.2-389+release-dist.tar.gz \
|
||||
RUN curl https://repo.metasfresh.com/repository/mvn-release-releases/de/metas/dist/metasfresh-dist-dist/5.174.2-461+release/metasfresh-dist-dist-5.174.2-461+release-dist.tar.gz \
|
||||
| tar -xzC /opt/metasfresh/
|
||||
RUN mkdir -p /opt/metasfresh/heapdump
|
||||
|
||||
|
||||
@@ -56,12 +56,18 @@ run_metasfresh()
|
||||
#2019-01-29 jb: added '-XX:HeapDumpPath=/opt/metasfresh/heapdump' to java opts
|
||||
# gh issue: https://github.com/metasfresh/metasfresh-docker/issues/41
|
||||
|
||||
#2022-04-23 ts: added '-Dloader.path=/opt/metasfresh/external-lib':
|
||||
# Allow loading jars from /opt/metasfresh/external-lib.
|
||||
# This assumes that the app uses PropertiesLauncher (can be verified by opening the jar e.g. with 7-zip and checking META-INF/MANIFEST.MF)
|
||||
# Also see https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#executable-jar-property-launcher-features
|
||||
|
||||
cd /opt/metasfresh/ && java \
|
||||
-Dsun.misc.URLClassPath.disableJarChecking=true \
|
||||
-Xmx1024M -XX:MaxPermSize=512M \
|
||||
-Xmx1024M \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh/heapdump \
|
||||
-DPropertyFile=/opt/metasfresh/metasfresh.properties \
|
||||
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8788 \
|
||||
-Dloader.path=/opt/metasfresh/external-lib \
|
||||
-Dcom.sun.net.ssl.enableECC=false \
|
||||
-jar metasfresh_server.jar
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM postgres:9.5
|
||||
FROM postgres:15.1
|
||||
|
||||
RUN apt update
|
||||
RUN apt install -y curl
|
||||
@@ -11,7 +11,7 @@ ENV LC_MESSAGES=en_US.UTF-8
|
||||
COPY sources/create_db.sh /docker-entrypoint-initdb.d/
|
||||
COPY sources/metasfresh.pgdump /tmp/
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["postgres"]
|
||||
EXPOSE 5432
|
||||
|
||||
@@ -19,6 +19,7 @@ app:
|
||||
volumes:
|
||||
- ./volumes/app/log:/opt/metasfresh/log:rw
|
||||
- ./volumes/app/heapdump:/opt/metasfresh/heapdump:rw
|
||||
- ./volumes/app/external-lib:/opt/metasfresh/external-lib:rw
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- METASFRESH_HOME=/opt/metasfresh
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:16.04
|
||||
FROM ubuntu:20.04
|
||||
|
||||
|
||||
RUN apt update && apt -y full-upgrade
|
||||
@@ -7,7 +7,7 @@ RUN apt autoclean && apt update
|
||||
RUN apt -y install netcat \
|
||||
&& apt -y install curl \
|
||||
&& apt -y install openjdk-8-jdk-headless \
|
||||
&& apt -y install postgresql-client-9.5 \
|
||||
&& apt -y install postgresql-client-12 \
|
||||
&& apt -y autoremove \
|
||||
&& apt -y autoclean
|
||||
|
||||
@@ -15,7 +15,7 @@ COPY sources/configs/local_settings.properties /root/
|
||||
RUN mkdir -p /opt/metasfresh-webui-api/metasfresh-webui-api \
|
||||
&& mkdir -p /opt/metasfresh-webui-api/log \
|
||||
&& mkdir -p /opt/metasfresh-webui-api/heapdump
|
||||
RUN curl https://repo.metasfresh.com/repository/mvn-release/de/metas/ui/web/metasfresh-webui-api/5.173.2-389+release/metasfresh-webui-api-5.173.2-389+release.jar \
|
||||
RUN curl https://repo.metasfresh.com/repository/mvn-release/de/metas/ui/web/metasfresh-webui-api/5.174.2-461+release/metasfresh-webui-api-5.174.2-461+release.jar \
|
||||
--output /opt/metasfresh-webui-api/metasfresh-webui-api.jar \
|
||||
&& chmod 750 /opt/metasfresh-webui-api/metasfresh-webui-api.jar
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
FROM ubuntu:16.04
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN apt update && apt -y full-upgrade
|
||||
RUN apt autoclean && apt update
|
||||
|
||||
RUN apt -y install apache2 \
|
||||
#thx to https://askubuntu.com/questions/909277/avoiding-user-interaction-with-tzdata-when-installing-certbot-in-a-docker-contai
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt -y install apache2 \
|
||||
&& apt -y autoremove \
|
||||
&& apt -y autoclean
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
|
||||
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
|
||||
ProxyPass ws://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
|
||||
ProxyPassReverse ws://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
|
||||
ProxyPassReverse ws://webapi:8080/stomp/
|
||||
ProxyPass http://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
|
||||
ProxyPassReverse http://webapi:8080/stomp/
|
||||
</Location>
|
||||
@@ -83,10 +83,18 @@
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
RewriteEngine On
|
||||
|
||||
# Existing file or directory
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteCond %{REQUEST_URI} !^/mobile?$
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# mobile UI
|
||||
RewriteCond %{REQUEST_URI} ^/mobile
|
||||
RewriteRule ^ /mobile/index.html [L]
|
||||
|
||||
# Fallback:
|
||||
RewriteRule ^ /index.html
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
<VirtualHost *:443>
|
||||
ProxyRequests Off
|
||||
DocumentRoot /opt/metasfresh-webui-frontend/dist/
|
||||
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
|
||||
|
||||
|
||||
# Logging
|
||||
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
|
||||
|
||||
# Debugging
|
||||
# NOTE: pls comment the ErrorLog and CustomLog entries above
|
||||
#ErrorLog /dev/stdout
|
||||
#TransferLog /dev/stdout
|
||||
#LogLevel alert rewrite:trace8
|
||||
|
||||
<Location /rest>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
@@ -78,33 +86,24 @@
|
||||
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
|
||||
</Location>
|
||||
|
||||
<Directory /opt/metasfresh-webui-frontend/dist/>
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
RewriteEngine On
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteCond %{REQUEST_URI} !^/mobile?$
|
||||
RewriteRule ^ - [L]
|
||||
RewriteRule ^ /index.html
|
||||
</Directory>
|
||||
<Directory /opt/metasfresh-webui-frontend/dist/>
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
RewriteEngine On
|
||||
|
||||
<Files index.html>
|
||||
FileETag None
|
||||
Header unset ETag
|
||||
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
|
||||
Header set Pragma "no-cache"
|
||||
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
|
||||
</Files>
|
||||
# Existing file or directory
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
<Files service-worker.js>
|
||||
FileETag None
|
||||
Header unset ETag
|
||||
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
|
||||
Header set Pragma "no-cache"
|
||||
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
|
||||
</Files>
|
||||
# mobile UI
|
||||
RewriteCond %{REQUEST_URI} ^/mobile
|
||||
RewriteRule ^ /mobile/index.html [L]
|
||||
|
||||
# Fallback:
|
||||
RewriteRule ^ /index.html
|
||||
</Directory>
|
||||
|
||||
SSLCertificateFile /etc/apache2/certs/fullchain.pem
|
||||
SSLCertificateKeyFile /etc/apache2/certs/privkey.pem
|
||||
|
||||
@@ -1 +1 @@
|
||||
e05fb14f424a57e00beb2ccf2b96992cf35afff2
|
||||
829fb345925d3ac279c12bd33e5f1456b4ef40e8
|
||||
@@ -1 +1 @@
|
||||
2021-10-25T11:33:52+02:00
|
||||
2022-03-18T05:58:38+01:00
|
||||
@@ -1 +1 @@
|
||||
e05fb14
|
||||
829fb34
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@@ -1 +1 @@
|
||||
<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"><meta name="mobile-web-app-capable" content="yes"><link rel="icon" type="image/png" href="/favicon.png"><title>Metasfresh</title><script defer="defer" src="/bundle-e05fb14f424a57e00beb2ccf2b96992cf35afff2-git-dd849f270cde19eb3c6a.js"></script></head><body><div id="root"></div><script src="/config.js"></script></body></html>
|
||||
<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"><meta name="mobile-web-app-capable" content="yes"><link rel="icon" type="image/png" href="/favicon.png"><title>Metasfresh</title><script defer="defer" src="/bundle-829fb345925d3ac279c12bd33e5f1456b4ef40e8-git-600a28bfd186015be05e.js"></script></head><body><div id="root"></div><script src="/config.js"></script></body></html>
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"build": {
|
||||
"releaseVersion": "5.173.2-386+release",
|
||||
"jenkinsBuildUrl": "https://jenkins.metasfresh.com/job/metasfresh/job/release/386/",
|
||||
"jenkinsBuildNo": "386",
|
||||
"releaseVersion": "5.174.2-458+release",
|
||||
"jenkinsBuildUrl": "https://jenkins.metasfresh.com/job/metasfresh/job/release/458/",
|
||||
"jenkinsBuildNo": "458",
|
||||
"jenkinsJobName": "metasfresh/release",
|
||||
"jenkinsBuildTag": "jenkins-metasfresh-release-386"
|
||||
"gitSHA1": "e05fb14f424a57e00beb2ccf2b96992cf35afff2"
|
||||
"jenkinsBuildTag": "jenkins-metasfresh-release-458"
|
||||
"gitSHA1": "829fb345925d3ac279c12bd33e5f1456b4ef40e8"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 636 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 781 B |
|
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 888 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
|
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 890 B |
|
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 932 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
@@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# if the environment parameter for "WEBAPI_URL" is set in docker-compose.yml, replace all placeholder variables with that parameter
|
||||
# otherwise, a manual edit of './webui/sources/configs/config.js' and './webui/sources/configs/mobile/config.js' is required
|
||||
#
|
||||
if [[ ! -z $WEBAPI_URL ]]; then
|
||||
sed -i 's,http\:\/\/MYDOCKERHOST\:PORT,'$WEBAPI_URL',g' /opt/metasfresh-webui-frontend/dist/config.js
|
||||
find /opt/metasfresh-webui-frontend/dist/ -type f -name 'config.js' -exec sed -i 's,http\:\/\/MYDOCKERHOST\:PORT,'$WEBAPI_URL',g' {} +
|
||||
fi
|
||||
|
||||
if [[ -f "/etc/apache2/certs/fullchain.pem" ]] && [[ -f "/etc/apache2/certs/privkey.pem" ]]; then
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#thx to https://github.com/tianon/docker-postgres-upgrade/tree/master/9.6-to-15
|
||||
|
||||
FROM postgres:15.1
|
||||
|
||||
RUN sed -i 's/$/ 9.5/' /etc/apt/sources.list.d/pgdg.list
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
postgresql-9.5=9.5.25-6.pgdg110+1 \
|
||||
postgresql-contrib-9.5=9.5.25-6.pgdg110+1 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
|
||||
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
|
||||
ENV LANG=de_DE.UTF-8
|
||||
ENV LANGUAGE=en_US.UTF-8
|
||||
ENV LC_MESSAGES=en_US.UTF-8
|
||||
|
||||
ENV PGBINOLD /usr/lib/postgresql/9.5/bin
|
||||
ENV PGBINNEW /usr/lib/postgresql/15/bin
|
||||
|
||||
ENV PGDATAOLD /var/lib/postgresql/9.5/data
|
||||
ENV PGDATANEW /var/lib/postgresql/15/data
|
||||
|
||||
RUN mkdir -p "$PGDATAOLD" "$PGDATANEW" \
|
||||
&& chown -R postgres:postgres /var/lib/postgresql
|
||||
|
||||
WORKDIR /var/lib/postgresql
|
||||
|
||||
COPY docker-upgrade /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-upgrade
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-upgrade"]
|
||||
|
||||
# recommended: --link
|
||||
CMD ["pg_upgrade"]
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# thx to https://github.com/tianon/docker-postgres-upgrade/tree/master/9.6-to-15
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -eq 0 -o "${1:0:1}" = '-' ]; then
|
||||
set -- pg_upgrade "$@"
|
||||
fi
|
||||
|
||||
if [ "$1" = 'pg_upgrade' -a "$(id -u)" = '0' ]; then
|
||||
mkdir -p "$PGDATAOLD" "$PGDATANEW"
|
||||
chmod 700 "$PGDATAOLD" "$PGDATANEW"
|
||||
chown postgres .
|
||||
chown -R postgres "$PGDATAOLD" "$PGDATANEW"
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
if [ "$1" = 'pg_upgrade' ]; then
|
||||
if [ ! -s "$PGDATANEW/PG_VERSION" ]; then
|
||||
PGDATA="$PGDATANEW" eval "initdb $POSTGRES_INITDB_ARGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
@@ -0,0 +1,12 @@
|
||||
FROM postgres:15.1
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
|
||||
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
|
||||
ENV LANG=de_DE.UTF-8
|
||||
ENV LANGUAGE=en_US.UTF-8
|
||||
ENV LC_MESSAGES=en_US.UTF-8
|
||||
|
||||
CMD ["postgres"]
|
||||
@@ -0,0 +1,14 @@
|
||||
version: '3'
|
||||
services:
|
||||
afterdb:
|
||||
build: db15
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./../volumes/newdb/data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=ip2LmNzXX8p8iXg9lZTWEJ9524kQDbXFudB7LR03T-xK9fLweX3TLMkA2AYcEiaS
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U metasfresh", "-d", "metasfresh" ]
|
||||
interval: 30s
|
||||
timeout: 60s
|
||||
retries: 5
|
||||
@@ -0,0 +1,21 @@
|
||||
version: '3'
|
||||
services:
|
||||
beforedb:
|
||||
build: ./../db
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U metasfresh", "-d", "metasfresh" ]
|
||||
interval: 30s
|
||||
timeout: 60s
|
||||
retries: 5
|
||||
volumes:
|
||||
- ./../volumes/db/data:/var/lib/postgresql/data
|
||||
- ./../volumes/db/log:/var/log/postgresql
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
- METASFRESH_USERNAME=metasfresh
|
||||
- METASFRESH_PASSWORD=metasfresh
|
||||
- METASFRESH_DBNAME=metasfresh
|
||||
- DB_SYSPASS=System
|
||||
- POSTGRES_PASSWORD=ip2LmNzXX8p8iXg9lZTWEJ9524kQDbXFudB7LR03T-xK9fLweX3TLMkA2AYcEiaS
|
||||
@@ -0,0 +1,11 @@
|
||||
version: '3'
|
||||
services:
|
||||
upgradedb:
|
||||
build: db-9.5-to-15
|
||||
image: upgradedb
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./../volumes/newdb/data:/var/lib/postgresql/15/data
|
||||
- ./../volumes/db/data:/var/lib/postgresql/9.5/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=ip2LmNzXX8p8iXg9lZTWEJ9524kQDbXFudB7LR03T-xK9fLweX3TLMkA2AYcEiaS
|
||||
@@ -0,0 +1,226 @@
|
||||
#!/bin/bash
|
||||
|
||||
#title :upgrade_postgres.sh
|
||||
#description :
|
||||
#author :max.rieck@metasfresh.com
|
||||
#date :2022-11-29
|
||||
#usage :nohup bash ./upgrade_postgres.sh
|
||||
#logs :tail -f nohup.out
|
||||
#
|
||||
# Prerequisites: Enough storage space to store a second db-volume
|
||||
#
|
||||
# unknown data-types aren't supported anymore, they should be altered before upgrade
|
||||
# SELECT *
|
||||
# FROM information_schema.columns
|
||||
# WHERE data_type ILIKE 'unknown';
|
||||
#
|
||||
# before starting set POSTGRES_PASSWORD in docker-compose-before-upgrade-postgres.yml
|
||||
# before starting set POSTGRES_PASSWORD in docker-compose-upgrade-postgres.yml
|
||||
# before starting set POSTGRES_PASSWORD in docker-compose-after-upgrade-postgres.yml
|
||||
#
|
||||
# ATTENTION:
|
||||
# this script generates and executes SQL to alternate Tables with oids
|
||||
#======================================================================================================
|
||||
|
||||
start=$(date +%s)
|
||||
|
||||
instance=$(basename "${PWD%/*}")
|
||||
|
||||
echo "stopping metasfresh instance $instance"
|
||||
docker-compose -p "$instance" stop
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Running}}' "${instance}"_db_1)" == "true" ] ; do
|
||||
sleep 2
|
||||
echo "waiting for $instance to stop..."
|
||||
done
|
||||
|
||||
echo "waiting for $instance to stop... done"
|
||||
echo ""
|
||||
|
||||
echo "docker-compose up -f docker-compose-before-upgrade-postgres.yml -p ${instance}-before-upgrade-postgres"
|
||||
|
||||
if ! docker-compose -f docker-compose-before-upgrade-postgres.yml -p "${instance}"-before-upgrade-postgres up -d; then
|
||||
end=$(date +%s)
|
||||
runtime=$((end-start))
|
||||
echo "script failed after ${runtime}s"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "starting postgres beforedb for handling tables with oids"
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Health.Status}}' "${instance}"-before-upgrade-postgres-beforedb-1)" != "healthy" ]; do
|
||||
echo "waiting for db..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "waiting for db... done"
|
||||
echo ""
|
||||
|
||||
echo "alter known oid-tables to without oids"
|
||||
docker exec -i "${instance}"-before-upgrade-postgres-beforedb-1 psql -U metasfresh -d metasfresh -tAc "
|
||||
ALTER TABLE de_metas_acct.accounting_docs_to_repost SET WITHOUT OIDS;
|
||||
ALTER TABLE public.c_invoice_candidate_recompute SET WITHOUT OIDS;
|
||||
ALTER TABLE public.fact_acct_log SET WITHOUT OIDS;
|
||||
"
|
||||
|
||||
docker exec -i "${instance}"-before-upgrade-postgres-beforedb-1 psql -U metasfresh -d metasfresh -tAc "
|
||||
SELECT quote_ident(nspname) || '.' || quote_ident(relname)
|
||||
FROM pg_catalog.pg_class c
|
||||
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE 1=1
|
||||
AND c.relkind = 'r'
|
||||
AND c.relhasoids = true
|
||||
AND n.nspname <> 'pg_catalog'
|
||||
order by n.nspname, c.relname;
|
||||
" >tables_with_oids.txt
|
||||
|
||||
rm handle_tables_with_oids.sql 2> /dev/null
|
||||
|
||||
while read -ru 3 p; do
|
||||
nextOID=$(docker exec -i "${instance}"-before-upgrade-postgres-beforedb-1 pg_controldata -D /var/lib/postgresql/data | grep OID)
|
||||
nextOID=${nextOID#"Latest checkpoint's NextOID:"}
|
||||
nextOID=${nextOID// /}
|
||||
|
||||
echo "
|
||||
|
||||
ALTER TABLE $p DISABLE TRIGGER ALL;
|
||||
ALTER TABLE $p ADD newoid bigint NOT NULL;
|
||||
UPDATE $p SET newoid = oid;
|
||||
ALTER TABLE $p SET WITHOUT OIDS;
|
||||
ALTER TABLE $p RENAME newoid TO oid;
|
||||
CREATE SEQUENCE IF NOT EXISTS oid_seq;
|
||||
ALTER TABLE $p ALTER oid SET DEFAULT nextval('oid_seq');
|
||||
SELECT setval('oid_seq', $nextOID);
|
||||
ALTER TABLE $p ENABLE TRIGGER ALL;
|
||||
|
||||
" >> handle_tables_with_oids.sql
|
||||
done 3< tables_with_oids.txt
|
||||
|
||||
oidsql=$(cat handle_tables_with_oids.sql)
|
||||
docker exec -i "${instance}"-before-upgrade-postgres-beforedb-1 psql -U metasfresh -d metasfresh -c "$oidsql"
|
||||
|
||||
echo "docker stop ${instance}-before-upgrade-postgres-beforedb-1"
|
||||
docker stop "${instance}"-before-upgrade-postgres-beforedb-1
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Running}}' "${instance}"-before-upgrade-postgres-beforedb-1)" == "true" ]; do
|
||||
sleep 2
|
||||
echo "waiting for ${instance}-before-upgrade-postgres-beforedb-1 to stop..."
|
||||
done
|
||||
|
||||
echo "waiting for ${instance}-before-upgrade-postgres-beforedb-1 to stop... done"
|
||||
|
||||
echo "docker rm ${instance}-before-upgrade-postgres-beforedb-1"
|
||||
docker rm "${instance}"-before-upgrade-postgres-beforedb-1
|
||||
|
||||
echo "docker-compose up -f docker-compose-upgrade-postgres.yml -p ${instance}-upgrade-postgres"
|
||||
docker-compose -f docker-compose-upgrade-postgres.yml -p "${instance}"-upgrade-postgres up
|
||||
|
||||
docker exec -i -u postgres "${instance}"-upgrade-postgres-upgradedb-1 cp ./update_extensions.sql /var/lib/postgresql/15/data/update_extensions.sql
|
||||
|
||||
upgradelogs=$(docker logs "${instance}"-upgrade-postgres-upgradedb-1 --tail 100)
|
||||
grep -wq "Upgrade Complete" <<< "$upgradelogs"
|
||||
upgradeComplete=$?
|
||||
|
||||
echo "docker stop ${instance}-upgrade-postgres-upgradedb-1"
|
||||
docker stop "${instance}"-upgrade-postgres-upgradedb-1
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Running}}' "${instance}"-upgrade-postgres-upgradedb-1)" == "true" ]; do
|
||||
sleep 2
|
||||
echo "waiting for ${instance}-upgrade-postgres-upgradedb-1 to stop..."
|
||||
done
|
||||
echo "waiting for ${instance}-upgrade-postgres-upgradedb-1 to stop... done"
|
||||
echo ""
|
||||
|
||||
echo "docker rm ${instance}-upgrade-postgres-upgradedb-1"
|
||||
docker rm "${instance}"-upgrade-postgres-upgradedb-1
|
||||
|
||||
if [ $upgradeComplete -ne 0 ]; then
|
||||
echo "upgrade failed removing newdb volume..."
|
||||
rm -r ./../volumes/newdb
|
||||
end=$(date +%s)
|
||||
runtime=$((end-start))
|
||||
echo "script failed after ${runtime}s"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "copying config files..."
|
||||
cp ./../volumes/db/data/pg_hba.conf ./../volumes/newdb/data/pg_hba.conf
|
||||
cp ./../volumes/db/data/postgresql.conf ./../volumes/newdb/data/postgresql.conf
|
||||
cp ./../volumes/db/data/postgresql.auto.conf ./../volumes/newdb/data/postgresql.auto.conf
|
||||
echo "copying config files... done"
|
||||
echo ""
|
||||
|
||||
docker-compose -f docker-compose-after-upgrade-postgres.yml -p "${instance}"-after-upgrade-postgres up -d
|
||||
|
||||
echo "starting postgres afterdb for update extensions, vacuumdb and reindex"
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Health.Status}}' "${instance}"-after-upgrade-postgres-afterdb-1)" != "healthy" ]; do
|
||||
echo "waiting for db..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "waiting for db... done"
|
||||
echo ""
|
||||
|
||||
echo "update extensions"
|
||||
docker exec -i -u postgres "${instance}"-after-upgrade-postgres-afterdb-1 psql -U metasfresh -d metasfresh -f "/var/lib/postgresql/data/update_extensions.sql"
|
||||
rm ./../volumes/newdb/data/update_extensions.sql
|
||||
echo ""
|
||||
|
||||
start_vacuumdb=$(date +%s)
|
||||
echo "vacuumdb -d metasfresh --analyze-in-stages -v"
|
||||
docker exec -i -u postgres "${instance}"-after-upgrade-postgres-afterdb-1 vacuumdb -d metasfresh --analyze-in-stages -v
|
||||
end_vacuumdb=$(date +%s)
|
||||
runtime_vacuumdb=$((end_vacuumdb-start_vacuumdb))
|
||||
echo "vacuumdb took ${runtime_vacuumdb}s"
|
||||
echo ""
|
||||
|
||||
start_reindex=$(date +%s)
|
||||
echo "REINDEX each table of metasfresh database"
|
||||
docker exec -i -u postgres "${instance}"-after-upgrade-postgres-afterdb-1 psql -U metasfresh -d metasfresh -tAc "
|
||||
SELECT 'REINDEX (VERBOSE, CONCURRENTLY) TABLE ' || quote_ident(nspname) || '.' || quote_ident(relname) || ' /*' || pg_size_pretty(pg_total_relation_size(C.oid)) || '*/;'
|
||||
FROM pg_class C
|
||||
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
||||
WHERE nspname <> 'pg_catalog'
|
||||
AND C.relkind = 'r'
|
||||
AND nspname !~ '^pg_toast'
|
||||
ORDER BY pg_total_relation_size(C.oid) ASC;
|
||||
" > tables_to_reindex.txt
|
||||
|
||||
#ignore table if needed
|
||||
#grep -v "tablename" tables_to_reindex.txt > tmpfile && mv tmpfile tables_to_reindex.txt
|
||||
|
||||
while read -ru 3 p; do
|
||||
echo "$p"
|
||||
docker exec -i -u postgres "${instance}"-after-upgrade-postgres-afterdb-1 psql -U metasfresh -d metasfresh -c "$p"
|
||||
echo ""
|
||||
done 3< tables_to_reindex.txt
|
||||
|
||||
end_reindex=$(date +%s)
|
||||
runtime_reindex=$((end_reindex-start_reindex))
|
||||
echo "REINDEX took ${runtime_reindex}s"
|
||||
echo ""
|
||||
|
||||
echo "docker stop afterdb"
|
||||
docker stop "${instance}"-after-upgrade-postgres-afterdb-1
|
||||
|
||||
while [ "$(docker inspect -f '{{.State.Running}}' "${instance}"-after-upgrade-postgres-afterdb-1)" == "true" ]; do
|
||||
sleep 2
|
||||
echo "waiting for ${instance}-after-upgrade-postgres-afterdb-1 to stop..."
|
||||
done
|
||||
|
||||
echo "waiting for ${instance}-after-upgrade-postgres-afterdb-1 to stop... done"
|
||||
|
||||
echo "docker rm afterdb"
|
||||
docker rm "${instance}"-after-upgrade-postgres-afterdb-1
|
||||
|
||||
mv ./../volumes/db ./../volumes/olddb
|
||||
mv ./../volumes/newdb ./../volumes/db
|
||||
|
||||
echo ""
|
||||
echo "upgrade done! You can now change db image and restart the instance"
|
||||
echo ""
|
||||
|
||||
end=$(date +%s)
|
||||
runtime=$((end-start))
|
||||
echo "script finished in ${runtime}s"
|
||||
@@ -0,0 +1 @@
|
||||
FROM postgrest/postgrest:latest
|
||||
@@ -5,6 +5,9 @@ FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.3
|
||||
# Also see https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-dev-mode
|
||||
ENV discovery.type=single-node
|
||||
|
||||
# mitigate CVE-2021-44228 log4j2 vulnerability - http://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-44228
|
||||
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
|
||||
|
||||
COPY sources/start-custom.sh /usr/local/bin/start-custom.sh
|
||||
RUN chmod +x /usr/local/bin/start-custom.sh
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
FROM metasfresh/metasfresh-webapi:5.173
|
||||
ARG BASE_REGISTRY=metasfresh
|
||||
FROM $BASE_REGISTRY/metasfresh-webapi:5.175
|
||||
|
||||
COPY sources/configs/* /opt/metasfresh-webui-api/
|
||||
COPY sources/start_webapi.sh /opt/metasfresh-webui-api/
|
||||
|
||||
@@ -16,6 +16,11 @@ spring.rabbitmq.port=5672
|
||||
spring.rabbitmq.username=metasfresh
|
||||
spring.rabbitmq.password=metasfresh
|
||||
|
||||
spring.rabbitmq.listener.direct.consumers-per-queue=1
|
||||
spring.rabbitmq.listener.direct.prefetch=1
|
||||
spring.rabbitmq.listener.simple.max-concurrency=1
|
||||
spring.rabbitmq.listener.simple.prefetch=1
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# Elasticsearch
|
||||
# for more properties, see https://github.com/spring-projects/spring-boot/blob/v1.4.1.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchProperties.java
|
||||
@@ -23,6 +28,7 @@ spring.rabbitmq.password=metasfresh
|
||||
# Elasticsearch cluster name.
|
||||
spring.data.elasticsearch.cluster-name=metasfresh
|
||||
spring.data.elasticsearch.cluster-nodes=search:9300
|
||||
spring.data.elasticsearch.client.reactive.endpoints=search:9200
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# Logging
|
||||
|
||||
@@ -25,7 +25,7 @@ wait_dbms()
|
||||
run_metasfresh()
|
||||
{
|
||||
cd /opt/metasfresh-webui-api/ && java -Dsun.misc.URLClassPath.disableJarChecking=true \
|
||||
-Xmx1024M -XX:MaxPermSize=512M \
|
||||
-Xmx1024M \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh-webui-api/heapdump \
|
||||
-DPropertyFile=/opt/metasfresh-webui-api/metasfresh.properties \
|
||||
-Dcom.sun.management.jmxremote.port=1618 \
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
FROM metasfresh/metasfresh-webui:5.173
|
||||
ARG BASE_REGISTRY=metasfresh
|
||||
FROM $BASE_REGISTRY/metasfresh-webui:5.175
|
||||
|
||||
COPY sources/configs/config.js /opt/metasfresh-webui-frontend/dist/
|
||||
COPY sources/configs/mobile/config.js /opt/metasfresh-webui-frontend/dist/mobile/
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
<VirtualHost *:80>
|
||||
ProxyRequests Off
|
||||
DocumentRoot /opt/metasfresh-webui-frontend/dist/
|
||||
|
||||
# Logging
|
||||
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
|
||||
|
||||
# Debugging
|
||||
# NOTE: pls comment the ErrorLog and CustomLog entries above
|
||||
#ErrorLog /dev/stdout
|
||||
#TransferLog /dev/stdout
|
||||
#LogLevel alert rewrite:trace8
|
||||
|
||||
<Location /rest>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
@@ -87,10 +96,17 @@
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
RewriteEngine On
|
||||
|
||||
# Existing file or directory
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteCond %{REQUEST_URI} !^/mobile?$
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# mobile UI
|
||||
RewriteCond %{REQUEST_URI} ^/mobile
|
||||
RewriteRule ^ /mobile/index.html [L]
|
||||
|
||||
# Fallback:
|
||||
RewriteRule ^ /index.html
|
||||
</Directory>
|
||||
|
||||
|
||||
@@ -2,8 +2,17 @@
|
||||
<VirtualHost *:443>
|
||||
ProxyRequests Off
|
||||
DocumentRoot /opt/metasfresh-webui-frontend/dist/
|
||||
|
||||
# Logging
|
||||
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
|
||||
|
||||
# Debugging
|
||||
# NOTE: pls comment the ErrorLog and CustomLog entries above
|
||||
#ErrorLog /dev/stdout
|
||||
#TransferLog /dev/stdout
|
||||
#LogLevel alert rewrite:trace8
|
||||
|
||||
<Location /rest>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
@@ -17,7 +26,7 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
|
||||
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
|
||||
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
|
||||
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
|
||||
ProxyPass wss://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
|
||||
ProxyPassReverse wss://webapi:8080/stomp/
|
||||
ProxyPass http://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
|
||||
@@ -88,10 +97,17 @@
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
RewriteEngine On
|
||||
|
||||
# Existing file or directory
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteCond %{REQUEST_URI} !^/mobile?$
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# mobile UI
|
||||
RewriteCond %{REQUEST_URI} ^/mobile
|
||||
RewriteRule ^ /mobile/index.html [L]
|
||||
|
||||
# Fallback:
|
||||
RewriteRule ^ /index.html
|
||||
</Directory>
|
||||
|
||||
|
||||