Skip to content

Dockerize the application#59

Merged
deshraj merged 5 commits intomasterfrom
docker
Aug 5, 2017
Merged

Dockerize the application#59
deshraj merged 5 commits intomasterfrom
docker

Conversation

@AvaisP
Copy link
Copy Markdown
Member

@AvaisP AvaisP commented Jul 30, 2017

No description provided.

@@ -0,0 +1 @@
__author__ = 'dkarchmer'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Umm... why we need this?

@@ -0,0 +1 @@
__author__ = 'dkarchmer'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can leave the file blank.

except:
raise CommandError('DB is not connected properly')

self.stdout.write(self.style.SUCCESS('Successfully created superuser')) No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a newline here.

@@ -0,0 +1,25 @@
FROM python:2.7
MAINTAINER Avais Pagarkar <avaispagarkar@gmail.com>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please change it to CloudCV Team <team@cloudcv.org>

psql -c "ALTER ROLE origamiuser SET client_encoding TO 'utf8'" -U postgres
psql -c "ALTER ROLE origamiuser SET default_transaction_isolation TO 'read committed'" -U postgres
psql -c "ALTER ROLE origamiuser SET timezone TO 'UTC'" -U postgres
psql -c "ALTER USER origamiuser CREATEDB" -U postgres
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@deshraj how can I read the database name, user and password from the environment instead of hardcoding it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can set environment variables in docker containers for this. See this https://docs.docker.com/compose/environment-variables/ for reference.

Copy link
Copy Markdown
Member Author

@AvaisP AvaisP Aug 2, 2017

Choose a reason for hiding this comment

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

@deshraj I tried it with an env file. It didn't work. I was probably making a mistake. To read the environment variable inside the psql statement, I need to do $ENV_VARIABLE_NAME right?

}
server {
listen 80;
server_name localhost;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@deshraj How do I read the server name from the environment instead of hardcoding it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this will be used for the production environment, you can hardcode the URL here.

@deshraj deshraj merged commit 35d7c75 into master Aug 5, 2017
@AvaisP AvaisP deleted the docker branch September 19, 2017 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants