-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes to the docker setup #15
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
version: '3' | ||
services: | ||
pretalx: | ||
eventyay-talk: | ||
image: eventyay/eventyay-talk:development | ||
container_name: eventyay-talk | ||
restart: unless-stopped | ||
|
@@ -19,9 +19,9 @@ services: | |
ports: | ||
- "127.0.0.1:8355:80" | ||
|
||
pretix: | ||
image: eventyay/eventyay-tickets:development | ||
container_name: eventyay-tickets | ||
eventyay-ticket: | ||
image: eventyay/eventyay-ticket:development | ||
container_name: eventyay-ticket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename service name, and use singular ticket name for docker image |
||
restart: unless-stopped | ||
depends_on: | ||
db: | ||
|
@@ -41,10 +41,11 @@ services: | |
restart: unless-stopped | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
- ./docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
environment: | ||
POSTGRES_USER: postgres_db_user_changeme | ||
POSTGRES_PASSWORD: postgres_db_pwd_changeme | ||
POSTGRES_DB: eventyay_db | ||
POSTGRES_MULTIPLE_DATABASES: eventyay_db,eventyay_ticket_db | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. define two databases, keep the one used for talks as is |
||
healthcheck: # TODO why can we not use $POSTGRES_USER and $POSTGRES_DB here, since it is in the env? | ||
test: ["CMD-SHELL", 'pg_isready -U postgres_db_user_changeme -d eventyay_db'] | ||
interval: 10s | ||
|
@@ -53,7 +54,7 @@ services: | |
|
||
redis: | ||
image: redis:latest | ||
container_name: pretalx-redis | ||
container_name: redis | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the correct redis service name |
||
restart: unless-stopped | ||
volumes: | ||
- pretalx-redis:/data | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
|
||
function create_user_and_database() { | ||
local database=$1 | ||
echo " Creating user and database '$database'" | ||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL | ||
CREATE USER $database; | ||
CREATE DATABASE $database; | ||
GRANT ALL PRIVILEGES ON DATABASE $database TO $database; | ||
EOSQL | ||
} | ||
|
||
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then | ||
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES" | ||
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do | ||
create_user_and_database $db | ||
done | ||
echo "Multiple databases created" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,11 @@ port = 25 | |
#ssl = True | ||
|
||
[celery] | ||
backend = redis://pretalx-redis/1 | ||
broker = redis://pretalx-redis/2 | ||
backend = redis://redis/1 | ||
broker = redis://redis/2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use correct redis service name |
||
|
||
[redis] | ||
location=redis://pretalx-redis/0 | ||
location=redis://redis/0 | ||
; Remove the following line if you are unsure about your redis' security | ||
; to reduce impact if redis gets compromised. | ||
sessions=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,8 @@ default=en | |
timezone=UTC | ||
|
||
[database] | ||
; Replace postgresql with mysql for MySQL | ||
backend=postgresql | ||
name=eventyay_db | ||
name=eventyay_ticket_db | ||
user=postgres_db_user_changeme | ||
; Replace with the password you chose above | ||
password=postgres_db_pwd_changeme | ||
|
@@ -52,5 +51,5 @@ location=redis://redis/0 | |
sessions=true | ||
|
||
[celery] | ||
backend=redis://redis/1 | ||
broker=redis://redis/2 | ||
backend=redis://redis/3 | ||
broker=redis://redis/4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use different redis database for ticket celery broker and backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename service name