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

Improve development environment configuration, support SELinux #257

Merged
merged 2 commits into from Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions .gitignore
Expand Up @@ -10,5 +10,20 @@ env
bigquery-credentials.json
*.bak

# Application data
/docker/data
# ListenBrainz application data
docker/data

# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Mm]an
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json

18 changes: 10 additions & 8 deletions docker/docker-compose.yml
Expand Up @@ -12,19 +12,21 @@ services:
db:
image: postgres:9.5.3
volumes:
- ./dbvolume:/var/lib/postgresql/data/
- ./dbvolume:/var/lib/postgresql/data:z
ports:
- "15432:5432"

redis:
image: redis:3.2.1
volumes:
- ./docker/data/redis:/data
- ./data/redis:/data:z
ports:
- "6379:6379"

influx:
image: influxdb:1.2.4
volumes:
- ./docker/data/influxdb:/var/lib/influxdb
- ./data/influxdb:/var/lib/influxdb:z
environment:
INFLUXDB_REPORTING_DISABLED: 'true'
INFLUXDB_META_LOGGING_ENABLED: 'false'
Expand All @@ -41,7 +43,7 @@ services:
rabbitmq:
image: rabbitmq:3.6.5
volumes:
- ./docker/data/rabbitmq:/var/lib/rabbitmq
- ./data/rabbitmq:/var/lib/rabbitmq:z
ports:
- "5672:5672"

Expand All @@ -52,12 +54,12 @@ services:
command: python3 /code/listenbrainz/manage.py runserver -h 0.0.0.0 -p 80 -d
image: web
volumes:
- ..:/code/listenbrainz
- ../credentials:/code/credentials
- ..:/code/listenbrainz:z
- ../credentials:/code/credentials:z
environment:
GOOGLE_APPLICATION_CREDENTIALS: '/code/credentials/bigquery-credentials.json'
ports:
- "80:80"
- "8000:80"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this at 80 and change the docs to 80 from 8000. Other MeB projects use 80 too and it is a good idea to keep as many similarities between projects as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paramsingh What if you're running multiple projects in your environment? For the host machine, I thought port 8000 made more sense since it's an unprivileged port, and you could use a web server (e.g. nginx) to do a rewrite rule for port 8000. In this way, port 8000 made more sense for both a development environment and running in production.

If you'd like, I can still change everything to port 80. But from my point of view, port 8000 makes more sense since port 80 is likely to conflict with other services / applications.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, 8000 does make more sense, I guess. I'm just hesitant because of other MeB projects using 80 (and a little, because my setup uses 80 :P). I'd be okay with 80 or 8000, but I guess we should make the port we choose here the standard for other MeB projects too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mayhem, any opinions on this? :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer consistency with other projects for now -- I agree with the reservations, but until we finally get some "best metabrainz docker practices" defined, lets go with 80.

Regardless of what we pick, people will complain about it. :)

depends_on:
- redis
- db
Expand All @@ -79,7 +81,7 @@ services:
context: ..
dockerfile: Dockerfile
volumes:
- ../credentials:/code/credentials
- ../credentials:/code/credentials:z
environment:
GOOGLE_APPLICATION_CREDENTIALS: '/code/credentials/bigquery-credentials.json'
command: python3 -m "listenbrainz.bigquery-writer.bigquery-writer"
Expand Down