Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Skip virtualenv creation
Patryk Zawadzkib930a5624942
diff --git a/Dockerfile b/Dockerfileindex 4d410b69c5..54da2ddf9d 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,4 +1,4 @@-### Build python virtualenv+### Build and install packagesFROM python:3.6 as build-pythonENV PYTHONUNBUFFERED 1@@ -9,9 +9,8 @@ RUN \apt-get clean && \rm -rf /var/lib/apt/lists/*-RUN python3 -m venv /app/virtualenvADD requirements.txt /app/-RUN /app/virtualenv/bin/pip install -r /app/requirements.txt+RUN pip install -r /app/requirements.txt### Build static assetsFROM node:8.6.0 as build-nodejs@@ -35,7 +34,8 @@ RUN apt-get update && \rm -rf /var/lib/apt/lists/*ADD . /app-COPY --from=build-python /app/virtualenv /app/virtualenv+COPY --from=build-python /usr/local/lib/python3.6/site-packages/ /usr/local/lib/python3.6/site-packages/+COPY --from=build-python /usr/local/bin/ /usr/local/bin/COPY --from=build-nodejs /app/saleor/static /app/saleor/staticCOPY --from=build-nodejs /app/webpack-bundle.json /app/COPY --from=build-nodejs /app/templates /app/templates@@ -47,11 +47,11 @@ RUN useradd --system saleor && \USER saleor-RUN SECRET_KEY=dummy /app/virtualenv/bin/python manage.py collectstatic --no-input+RUN SECRET_KEY=dummy python3 manage.py collectstatic --no-inputEXPOSE 8000ENV PORT 8000ENV PYTHONUNBUFFERED 1ENV PROCESSES 4-CMD ["/app/virtualenv/bin/uwsgi", "/app/saleor/wsgi/uwsgi.ini"]+CMD ["uwsgi", "/app/saleor/wsgi/uwsgi.ini"]diff --git a/docs/customization/docker.rst b/docs/customization/docker.rstindex e2c5e076e1..4b4b346ebd 100644--- a/docs/customization/docker.rst+++ b/docs/customization/docker.rst@@ -14,61 +14,36 @@ Using Docker to build software allows you to run and test code without having toLocal Prerequisites--------------------You will need to install Docker and-`docker-compose <https://docs.docker.com/compose/install/>`_ before-performing the following steps.--To build assets you will need `node <https://nodejs.org/en/download/package-manager/>`_ and `webpack module bundler <https://webpack.github.io/>`_.+You will need to install Docker and `docker-compose <https://docs.docker.com/compose/install/>`_ before performing the following steps... note::- Our configuration exposes PostgreSQL, Redis and Elasticsearch ports. If you have problems running this docker file because of port conflicts, you can remove 'ports' section from docker-compose.yml+ Our configuration exposes PostgreSQL, Redis and Elasticsearch ports. If you have problems running this docker file because of port conflicts, you can remove ``ports`` section from ``docker-compose.yml``.Usage------1. Install JavaScript dependencies-- .. code-block:: bash-- $ npm install---2. Prepare static assets-- .. code-block:: bash-- $ npm run build-assets---3. Build emails-- .. code-block:: bash-- $ npm run build-emails---4. Build the containers using ``docker-compose``+1. Build the containers using ``docker-compose``.. code-block:: bash$ docker-compose build-5. Prepare the database+2. Prepare the database.. code-block:: bash- $ docker-compose run web python manage.py migrate- $ docker-compose run web python manage.py collectstatic- $ docker-compose run web python manage.py populatedb --createsuperuser+ $ docker-compose run web python3 manage.py migrate+ $ docker-compose run web python3 manage.py collectstatic+ $ docker-compose run web python3 manage.py populatedb --createsuperuserThe ``--createsuperuser`` switch creates an admin account for``[email protected]`` with the password set to ``admin``.-6. Run the containers+3. Run the containers.. code-block:: bashdiff --git a/docs/deployment/docker.rst b/docs/deployment/docker.rstindex 319ced3d3d..1fc65dca8b 100644--- a/docs/deployment/docker.rst+++ b/docs/deployment/docker.rst@@ -5,14 +5,6 @@ DockerYou will need to install Docker first.-Before building the image make sure you have all of the front-end assets prepared for production:--.. code-block:: bash-- $ npm run build-assets --production- $ npm run build-emails- $ python manage.py collectstatic-Then use Docker to build the image:.. code-block:: bash