misc: minor improvements on data storage on production images

This commit is contained in:
Andrey Antukh 2019-07-05 15:24:11 +02:00
parent e786a85bbd
commit 1fce679402
3 changed files with 9 additions and 4 deletions

View file

@ -10,6 +10,7 @@ RUN set -ex; \
apt-get update -yq && \ apt-get update -yq && \
apt-get install -yq \ apt-get install -yq \
curl \ curl \
rsync \
git \ git \
imagemagick \ imagemagick \
webp webp
@ -25,9 +26,8 @@ COPY ./dist /srv/uxbox
RUN set -ex; \ RUN set -ex; \
chmod 755 /entrypoint.sh; \ chmod 755 /entrypoint.sh; \
mkdir -p /srv/uxbox/resources/media mkdir /srv/uxbox/data;
VOLUME /srv/uxbox/resources/public
WORKDIR /srv/uxbox/ WORKDIR /srv/uxbox/
EXPOSE 6060 EXPOSE 6060

View file

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
echo "Setting up UXBOX Backend..."
echo "Synchronize static data..."
rsync -avr --delete ./resources/public/static/ ./data/static/
echo "Setting up UXBOX Backend..."
exec "$@" exec "$@"

View file

@ -36,7 +36,7 @@ services:
ports: ports:
- 6060 - 6060
volumes: volumes:
- backend_data:/srv/uxbox/resources/public - backend_data:/srv/uxbox/data
- backend_m2:/root/.m2 - backend_m2:/root/.m2
# - /etc/localtime:/etc/localtime:ro # - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro # - /etc/timezone:/etc/timezone:ro
@ -46,6 +46,8 @@ services:
- UXBOX_HTTP_SERVER_DEBUG=false - UXBOX_HTTP_SERVER_DEBUG=false
- UXBOX_MEDIA_URI="/media/" - UXBOX_MEDIA_URI="/media/"
- UXBOX_ASSETS_URI="/static/" - UXBOX_ASSETS_URI="/static/"
- UXBOX_MEDIA_DIRECTORY="data/media"
- UXBOX_ASSETS_DIRECTORY="data/static"
# Database setup # Database setup
- UXBOX_DATABASE_USERNAME="uxbox" - UXBOX_DATABASE_USERNAME="uxbox"
- UXBOX_DATABASE_PASSWORD="uxbox_postgres_password" - UXBOX_DATABASE_PASSWORD="uxbox_postgres_password"