Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker compose file to run sandbox locally #4277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3.8'

services:
db:
image: postgres:latest
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${COMPOSE_PROJECT_NAME}
- POSTGRES_USER=${COMPOSE_PROJECT_NAME}_user
- POSTGRES_PASSWORD=${COMPOSE_PROJECT_NAME}_pwd
volumes:
- postgres:/var/lib/postgresql/data
web:
build: .
ports:
- "8080:8080"
volumes:
- ./src:/app/src
- ./tests:/app/tests
environment:
- ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
- DATABASE_ENGINE=django.db.backends.postgresql
- DATABASE_NAME=${COMPOSE_PROJECT_NAME}
- DATABASE_USER=${COMPOSE_PROJECT_NAME}_user
- DATABASE_PASSWORD=${COMPOSE_PROJECT_NAME}_pwd
- DATABASE_HOST=db
tty: true

volumes:
postgres:
name: ${COMPOSE_PROJECT_NAME}_postgres
8 changes: 8 additions & 0 deletions docs/source/internals/sandbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,11 @@ To run the Oscar sandbox using `Docker`_, run the following commands:

$ docker pull oscarcommerce/django-oscar-sandbox
$ docker run -p 8080:8080/tcp oscarcommerce/django-oscar-sandbox:latest

If you want to run locally using docker, you can use docker compose:

.. code-block:: bash

$ docker compose up

In both case, sandbox site is available at http://localhost:8080/