-
Notifications
You must be signed in to change notification settings - Fork 33
Adding docker setup feature #3
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
base: master
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FROM postgres:14.5 | ||
| # requirements to run ./download | ||
| RUN apt-get update | ||
| RUN apt-get install -y wget && apt-get install -y bzip2 | ||
|
Collaborator
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. Those could be folded into one |
||
|
|
||
| COPY . omdb-postgresql | ||
| COPY docker-import /docker-entrypoint-initdb.d/docker-import.sh | ||
|
|
||
| WORKDIR omdb-postgresql | ||
|
|
||
| RUN "./download" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| version: "3" | ||
|
|
||
| services: | ||
| db: | ||
| build: . | ||
| container_name: "postgres_db" | ||
| environment: | ||
| POSTGRES_PASSWORD: omdbmovies | ||
| POSTGRES_USER: omdbmovies | ||
| POSTGRES_NAME: omdbmovies | ||
|
Collaborator
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. Was that supposed to be |
||
| ports: | ||
| - "54325:5432" | ||
|
Collaborator
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. Is that |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/sh | ||
| set -eux | ||
|
|
||
| psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | ||
|
Collaborator
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. Where is |
||
| CREATE USER docker; | ||
| CREATE DATABASE demo; | ||
| GRANT ALL PRIVILEGES ON DATABASE demo TO docker; | ||
|
Comment on lines
+6
to
+7
Collaborator
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. This Probably creating and using a |
||
| CREATE EXTENSION IF NOT EXISTS tsm_system_rows; | ||
| \i omdb.sql | ||
| EOSQL | ||
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.
I know it's been a while, but the Postgres version should be bumped to something newer (or
latest?)