Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Simplify docker setup

Patryk Zawadzki893708889f12
diff --git a/.dockerignore b/.dockerignore
index 8d5f76b4e7..7755a930b0 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -2,4 +2,3 @@
*.sqlite
media
node_modules
-static
diff --git a/Dockerfile b/Dockerfile
index 7ef31057a7..e45df22918 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,37 +1,11 @@
FROM python:3.5
ENV PYTHONUNBUFFERED 1
-RUN \
- apt-get -y update && \
- apt-get install -y apt-transport-https
-
-RUN \
- apt-key adv --keyserver keyserver.ubuntu.com --recv 68576280 && \
- echo 'deb https://deb.nodesource.com/node_6.x jessie main' | tee /etc/apt/sources.list.d/nodesource.list && \
- echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' | tee -a /etc/apt/sources.list.d/nodesource.list
-
-RUN \
- apt-get -y update && \
- apt-get install -y nodejs && \
- apt-get clean
-
-ADD requirements.txt /app/requirements.txt
-RUN cd /app && pip install -r requirements.txt
-
-ADD package.json /app/package.json
-RUN cd /app && npm install
-
-RUN useradd -ms /bin/bash saleor
-
ADD . /app
+RUN pip install -r /app/requirements.txt
WORKDIR /app
-ENV PATH $PATH:/app/node_modules/.bin
-RUN npm run build-assets
-RUN SECRET_KEY=tmpkey python manage.py collectstatic --noinput
-
EXPOSE 8000
ENV PORT 8000
-ENTRYPOINT ["/app/compose/entrypoint.sh"]
-CMD ["uwsgi saleor/wsgi/uwsgi.ini"]
+CMD ["uwsgi", "/app/saleor/wsgi/uwsgi.ini"]
diff --git a/compose/entrypoint.sh b/compose/entrypoint.sh
deleted file mode 100755
index 68bf31f33d..0000000000
--- a/compose/entrypoint.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-set -e
-
-USER=saleor
-APP_UID=$(stat -c "%u" /app)
-
-export DATABASE_URL=postgres://$DB_ENV_POSTGRES_USER:$DB_ENV_POSTGRES_PASSWORD@db:5432/$DB_ENV_POSTGRES_USER
-export EMAIL_URL=smtp://:@mailcatcher:1025/
-export REDIS_URL=redis://redis:6379/0
-
-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
-
-$*
diff --git a/docker-compose.yml b/docker-compose.yml
index 13dcd88487..b11da5d661 100755
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,10 +11,12 @@ mailcatcher:
- '1080:1080'
web:
build: .
+ command: python manage.py runserver 0.0.0.0:8000
environment:
- DATABASE_URL=postgres://saleor:saleor@db/saleor
- - REDIS_URL=redis://redis/
+ - EMAIL_URL=smtp://:@mailcatcher:1025/
+ - REDIS_URL=redis://redis:6379/0
- SECRET_KEY=changeme
links:
- db
@@ -23,4 +25,4 @@ web:
ports:
- '8000:8000'
volumes:
- - .:/app
+ - .:/app:Z