1
0
Fork 0

Pin container versions, simplify initial setup

This commit is contained in:
Piotr Dobrowolski 2020-05-12 20:56:44 +02:00
parent af9ed46861
commit 5e598d80b4
9 changed files with 38 additions and 19 deletions

11
.dockerignore Normal file
View File

@ -0,0 +1,11 @@
*.py[co]
db.sqlite3
*.swp
spejstore.env
env/
backups
media/
django-tree/
postgres-hstore/
.ropeproject/
docker-compose.yml

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ media/
django-tree/
postgres-hstore/
.ropeproject/
docker-compose.override.yml

View File

@ -1,4 +1,4 @@
FROM python:3.5
FROM python:3.5.9@sha256:3a71fd2dac2343263993f4ab898c9398dfbfd0235dafe41e784876b69bdfa899
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code

View File

@ -7,13 +7,12 @@ Please use Python3, for the love of `$deity`...
### Quick start
1. Open `docker-compose.yml` and make changes as comments indicate (TODO: Please someone make this not awful)
2. Run:
1. Run:
```sh
ln -s docker-compose.dev-override.yml docker-compose.override.yml
docker-compose up --build
```
3. Open `spejstore/urls.py` and comment out `url(r'^admin/login/.*', auth_redirect),`
4. Run `docker-compose run --rm web python manage.py createsuperuser` -- now you can dev authenticate w/o SSO
2. Run `docker-compose run --rm web python manage.py createsuperuser` -- now you can dev authenticate w/o SSO
### Build & run

View File

@ -0,0 +1,6 @@
version: "3"
services:
web:
environment:
- SPEJSTORE_ENV=dev
- SPEJSTORE_ALLOWED_HOSTS=localhost,127.0.0.1

View File

@ -0,0 +1,6 @@
version: "3"
services:
db:
volumes:
- /var/spejstore-data:/var/lib/postgresql/data

View File

@ -1,14 +1,10 @@
version: "2.3"
version: "3"
services:
db:
build: postgres-hstore
restart: always
# NOTE: Comment out `volumes` for development
volumes:
- /var/spejstore-data:/var/lib/postgresql/data
# NOTE: Uncomment this awful thing for development
# environment:
# - POSTGRES_HOST_AUTH_METHOD=trust
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
web:
build: .
@ -20,8 +16,7 @@ services:
- "8000:8000"
depends_on:
- db
env_file:
- spejstore-dev.env
# NOTE: Comment out this for development
- spejstore.env
environment:
- SPEJSTORE_CLIENT_ID
- SPEJSTORE_SECRET
- SPEJSTORE_ENV

View File

@ -1,3 +1,3 @@
FROM postgres:latest
FROM postgres:9.6.17@sha256:5b39dd4a26a02fee26902c84d8bafb2eb0ab9a2874fb0be22056107aa6508899
MAINTAINER Piotr Dobrowolski
ADD create_extension.sh /docker-entrypoint-initdb.d/create_extension.sh

View File

@ -21,8 +21,9 @@ router.register(r'labels', apiviews.LabelViewSet)
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
urlpatterns = ([
url(r'^admin/login/.*', auth_redirect),
] if settings.PROD else []) + [
url(r'^admin/', admin.site.urls),
url(r'^select2/', include('django_select2.urls')),