Skip to content

Commit

Permalink
Add initial fixture for setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nezhar committed Oct 17, 2021
1 parent b5566ee commit 0be52cd
Show file tree
Hide file tree
Showing 5 changed files with 1,607 additions and 6 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SnyPy Docker Setup

## Setup Application

* Create `docker-compose.override.yml` based on `docker-compose.override.example.yml` on adapt configuration
* Start containers: `docker-compose up`
* Run migrations: `docker-compose run --rm app python manage.py migrate`
* Load data from fixture: `docker-compose run --rm app python manage.py loaddata /fixtures/setup.json`

## Working with fixtures

Fixtures can be used in order to speed up the setup of the application.

### Creat a new fixtures

```bash
docker-compose run --rm app python manage.py dumpdata --indent 4 --output /fixtures/setup.json --natural-foreign --natural-primary auth users shares snippets teams
```
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /usr/src/app
RUN git clone https://github.com/nezhar/snypy-backend .
RUN pip install pip -U
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install gunicorn
RUN pip install gunicorn psycopg2-binary

WORKDIR /usr/src/app/snypy
EXPOSE 8000
Loading

0 comments on commit 0be52cd

Please sign in to comment.