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

Docker added #121

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:2.7
RUN apt-get update \
&& apt-get install -y postgresql postgresql-contrib build-essential libmemcached-dev zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir /swapi
WORKDIR /swapi
COPY . /swapi

#RUN apk add --update alpine-sdk
#RUN apk add --no-cache postgresql-libs postgresql-dev

RUN make install \
&& make build \
&& make load_data

CMD [ "make", "serve"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ load_data:
python manage.py loaddata films.json

serve:
python manage.py runserver
python manage.py runserver 0.0.0.0:8080

dump_data:
python manage.py dumpdata resources.planet > resources/fixtures/planets.json --indent 4
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

Source code for [swapi.co](https://swapi.co)

## Docker

To run Swapi on your Docker installation see the included Dockerfile. It is also available at Docker Hub <https://cloud.docker.com/repository/docker/svenwal/swapi/general>


```
docker run -d -p 8080:8080 svenwal/swapi
curl http://localhost:8080/api/people/1/
```

[![Circle CI](https://circleci.com/gh/phalt/swapi.svg?style=svg)](https://circleci.com/gh/phalt/swapi)

## Contributing

For contributing, please see CONTRIBUTING.md