Skip to content

Commit 17c68d7

Browse files
committed
Add basic Docker setup
After cloning, simply: ```sh docker-compose build docker-compose run --rm mongoengine python setup.py test ```
1 parent 8b5cf9e commit 17c68d7

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.8-slim-buster AS build
2+
3+
COPY requirements-dev.txt .
4+
RUN pip install --upgrade pip
5+
RUN pip install -r requirements-dev.txt
6+
RUN pip install "pymongo>=3.4,<4.0"
7+
8+
WORKDIR /app
9+
COPY . ./

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3.4'
2+
services:
3+
mongoengine:
4+
build:
5+
context: .
6+
image: mongoengine:latest
7+
network_mode: host
8+
depends_on:
9+
- mongo
10+
working_dir: /app
11+
volumes:
12+
- .:/app
13+
mongo:
14+
image: mongo:4
15+
restart: always
16+
ports:
17+
- 27017:27017

0 commit comments

Comments
 (0)