This repository is a simple fork of the PremierLangage great project to which a dockering procedure has simply been added. You can quickly deploy:
Please, refer to the original Github repository and the original demo site for more details.
In order to run this container you'll need docker installed.
This docker image is based on python:3.
It includes the packages needed to run PremierLangage (Especially Django). All the code for this repository is copied to the docker in the folder /usr/src/app.
To run a simple example, you can use the file docker-compose.yml
version: '3'
services:
pl:
image: pcourbin/pl:0.7.1
environment:
- PL_ENV_TYPE=local
- DATABASE_HOST=pg
- DATABASE_USERNAME=pl
- DATABASE_PASSWORD=plpassword
- ALLOWED_HOSTS=*
- SECRET_KEY=mygreatsupersecretkey
ports:
- 8000:8000
links:
- pg
pg:
image: postgres
environment:
- POSTGRES_USER=pl
- POSTGRES_PASSWORD=plpassword
- POSTGRES_DB=django_premierlangage
and run
docker-compose up
Then, go to http://localhost:8000 and use super user credentials:
adminadminadmin| Name | Default | Possibles values | Description |
|---|---|---|---|
PL_ENV_TYPE | db | local, release, db | See details below |
PL_STATIC_FILES | true | true, false | Collect static files. See details in Django documentation |
DATABASE_HOST | 127.0.0.1 | * | Host of the postgresql database |
DATABASE_PORT | 5432 | * | Port of the postgresql database |
DATABASE_NAME | django_premierlangage | * | Name of the postgresql database |
DATABASE_USERNAME | django | * | Username of the postgresql database which has access to the DATABASE_NAME postgresql database |
DATABASE_PASSWORD | django_password | * | Password of DATABASE_USERNAME |
SANDBOX_URL | http://127.0.0.1:7000/sandbox | * | See specific Github repository of PremierLangage Sandbox for details. |
ALLOWED_HOSTS | 127.0.0.1 | * | Configuration of the allowed hosts of Django. See details in Django documentation |
SECRET_KEY | defaultsecretkey | * | Configuration of the secret key for a particular Django installation. See details in Django documentation |
PL_ENV_TYPE options| Value | Description | Users (login/password) |
|---|---|---|
db | Only deploy the docker without any database initialisation. (if you already have your own filled database). | See your database. |
local | Deploy a quick version with default user. script\fill_database_local.py is run at first startup. | admin/adminadmin |
release | Deploy a quick version without default. script\fill_database_release.py is run at first startup. | Run python3 manage.py createsuperuser in your docker to create admin user. |
To run a simple example, you can use the file docker-compose.yml and edit PL_ENV_TYPEto release
version: '3'
services:
pl:
image: pcourbin/pl:0.7.1
environment:
- PL_ENV_TYPE=release
- DATABASE_HOST=pg
- DATABASE_USERNAME=pl
- DATABASE_PASSWORD=plpassword
- ALLOWED_HOSTS=*
- SECRET_KEY=mygreatsupersecretkey
ports:
- 8000:8000
links:
- pg
pg:
image: postgres
environment:
- POSTGRES_USER=pl
- POSTGRES_PASSWORD=plpassword
- POSTGRES_DB=django_premierlangage
then run
docker-compose up
next, you need to create an admin user with:
docker-compose exec pl python3 manage.py createsuperuser
Then, go to http://localhost:8000 and use your user credentials.
To run a dockerized version of the environment but using your code as application :
docker-dev-prepare.shwhich will download some librairies with pipdocker-compose-dev.yml which mount the current folder as the application folder /usr/src/appdocker-compose -f docker-compose-dev.yml buildContent type
Image
Digest
Size
507.6 MB
Last updated
over 6 years ago
docker pull pcourbin/pl:0.7.1