Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Prepare static files inside the image file
Adam Bogdał98807dd05472
diff --git a/Dockerfile b/Dockerfileindex 1510f87343..898bd8a3b2 100755--- a/Dockerfile+++ b/Dockerfile@@ -7,15 +7,24 @@ RUN \apt-get clean && \ln -s /usr/bin/nodejs /usr/bin/node-ADD setup.py /app/setup.pyADD requirements.txt /app/requirements.txtRUN cd /app && pip install -r requirements.txt-ADD package.json /node/package.json-RUN cd /node && npm install+ADD package.json /app/package.json+RUN cd /app && npm install++RUN useradd -ms /bin/bash saleorADD . /appWORKDIR /app+ENV PATH $PATH:/app/node_modules/.bin+RUN echo "{\"allow_root\": true }" > ~/.bowerrc+RUN bower install && grunt+RUN python manage.py collectstatic --noinput+EXPOSE 8000+ENV PORT 8000+ENTRYPOINT ["/app/compose/entrypoint.sh"]+CMD uwsgi saleor/wsgi/uwsgi.inidiff --git a/compose/entrypoint.sh b/compose/entrypoint.shindex 9fdad117ef..bf3db2e990 100755--- a/compose/entrypoint.sh+++ b/compose/entrypoint.sh@@ -2,17 +2,15 @@set -eUSER=saleor+APP_UID=`stat -c "%u" /app`export DATABASE_URL=postgres://$DB_ENV_DB_USER:$DB_ENV_DB_PASS@db/$DB_ENV_DB_NAME-if [ $(cat /etc/passwd | grep $USER | wc -l) == "0" ]; then- useradd -u `stat -c "%u" /app` -m $USER+if [ $APP_UID != "0" ]; then+ if [ $APP_UID != $(id -u $USER) ]; then+ usermod -u $APP_UID $USER+ fi+ su $USER -c "PATH=$PATH:/app/node_modules/.bin $*"fi-chown $USER.$USER /node -R-if [[ ( $1 == "/app/compose/start.sh" ) && ( ! -d "/app/node_modules" ) ]]; then- echo Copying /node/node_modules to /app/node_modules..- su saleor -c "cp -r /node/node_modules /app"-fi--su saleor -c "PATH=$PATH:/app/node_modules/.bin $*"+exec "$@"diff --git a/compose/start.sh b/compose/start.shdeleted file mode 100755index 7bdeb7c07e..0000000000--- a/compose/start.sh+++ /dev/null@@ -1,7 +0,0 @@-#!/bin/bash--bower install-grunt-saleor collectstatic --noinput--gunicorn saleor.wsgi.static -b 0.0.0.0:8000 --log-file -diff --git a/docker-compose.yml b/docker-compose.ymlindex c5ec9a8aae..6a244fc0e3 100755--- a/docker-compose.yml+++ b/docker-compose.yml@@ -12,4 +12,3 @@ web:- '8000:8000'volumes:- .:/app- command: /app/compose/start.sh