Skip to content

Commit

Permalink
Simplify docker setup
Browse files Browse the repository at this point in the history
Allow using docker for local development and drop node from the build
process.
  • Loading branch information
patrys committed Aug 30, 2016
1 parent 517229e commit 8937088
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 50 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
*.sqlite
media
node_modules
static
30 changes: 2 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
18 changes: 0 additions & 18 deletions compose/entrypoint.sh

This file was deleted.

8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- DEFAULT_FROM_EMAIL=info@getsaleor.com
- REDIS_URL=redis://redis/
- DEFAULT_FROM_EMAIL=noreply@example.com
- EMAIL_URL=smtp://:@mailcatcher:1025/
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=changeme
links:
- db
Expand All @@ -23,4 +25,4 @@ web:
ports:
- '8000:8000'
volumes:
- .:/app
- .:/app:Z

0 comments on commit 8937088

Please sign in to comment.