Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ docker compose up --build
docker compose exec web bash -c 'pytest'
# or faster tests without coverage
docker compose exec web bash -c 'ptw . --runner ./fast-pytest --now --delay 0.1'

# flake
docker compose exec web bash -c 'flake8 tests/'
```


Expand Down
9 changes: 9 additions & 0 deletions db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
8 changes: 8 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ services:
- UID=${UID:-1000}
- GID=${GID:-1000}

json_server:
build:
context: json_server
volumes:
- .:/app
ports:
- "3000:80"

networks:
# Fake API network:
bitrixnet:
2 changes: 1 addition & 1 deletion fast-pytest-setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DJANGO_SETTINGS_MODULE = server.settings
# You should adjust this value to be as low as possible.
# Configuration:
# https://pypi.org/project/pytest-timeout/
timeout = 5
timeout = 1

# Strict `@xfail` by default:
xfail_strict = true
Expand Down
13 changes: 13 additions & 0 deletions json_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14.15-slim

RUN mkdir /app
WORKDIR /app

ENV JSON_SERVER_VERSION=0.16.3

RUN npm install -g json-server@${JSON_SERVER_VERSION}
COPY package.json package-lock.json ./
RUN npm ci --only="prod"

EXPOSE 80
CMD [ "json-server", "db.json", "--host", "0.0.0.0", "--port", "80" ]
Loading