Skip to content

Commit 1582ffc

Browse files
committed
Update example folder.
1 parent e7b9dcf commit 1582ffc

File tree

2 files changed

+22
-35
lines changed

2 files changed

+22
-35
lines changed

example/Dockerfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
FROM python:3-onbuild
1+
FROM python:3.11-slim
2+
3+
WORKDIR /usr/src/app
4+
5+
# Copy requirements and install dependencies
6+
COPY requirements.txt .
7+
RUN pip install --upgrade pip && \
8+
pip install --no-cache-dir -r requirements.txt
9+
10+
# Copy application code
11+
COPY . .
212

313
RUN [ "python", "manage.py", "migrate" ]
414
RUN [ "python", "manage.py", "creatersakey" ]
15+
16+
# Create superuser with admin:admin credentials
17+
ENV DJANGO_SUPERUSER_USERNAME=admin
18+
19+
ENV DJANGO_SUPERUSER_PASSWORD=admin
20+
RUN [ "python", "manage.py", "createsuperuser", "--noinput" ]
21+
522
EXPOSE 8000
623
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]

example/README.md

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,18 @@
11
# Example Project
22

3-
![Example Project](https://s17.postimg.org/4jjj8lavj/Screen_Shot_2016_09_07_at_15_58_43.png)
4-
53
On this example you'll be running your own OIDC provider in a second. This is a Django app with all the necessary things to work with `django-oidc-provider` package.
64

7-
## Setup & Running
8-
9-
- [Manually](#manually)
10-
- [Using Docker](#using-docker)
11-
12-
### Manually
13-
14-
Setup project environment with [virtualenv](https://virtualenv.pypa.io) and [pip](https://pip.pypa.io).
15-
16-
```bash
17-
$ virtualenv -p /usr/bin/python3 project_env
18-
19-
$ source project_env/bin/activate
20-
21-
$ git clone https://github.com/juanifioren/django-oidc-provider.git
22-
$ cd django-oidc-provider/example
23-
$ pip install -r requirements.txt
24-
```
25-
26-
Run your provider.
27-
28-
```bash
29-
$ python manage.py migrate
30-
$ python manage.py creatersakey
31-
$ python manage.py createsuperuser
32-
$ python manage.py runserver
33-
```
34-
35-
Open your browser and go to `http://localhost:8000`. Voilà!
36-
37-
### Using Docker
5+
## Setup & running using Docker
386

397
Build and run the container.
408

419
```bash
4210
$ docker build -t django-oidc-provider .
43-
$ docker run -d -p 8000:8000 django-oidc-provider
11+
$ docker run -p 8000:8000 --name django-oidc-provider-app django-oidc-provider
4412
```
4513

14+
Go to http://localhost:8000/ and create your Client.
15+
4616
## Install package for development
4717

4818
After you run `pip install -r requirements.txt`.

0 commit comments

Comments
 (0)