Conversation
api/management/commands/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| __author__ = 'dkarchmer' | |||
api/management/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| __author__ = 'dkarchmer' | |||
api/management/commands/initadmin.py
Outdated
| except: | ||
| raise CommandError('DB is not connected properly') | ||
|
|
||
| self.stdout.write(self.style.SUCCESS('Successfully created superuser')) No newline at end of file |
docker/django/Dockerfile
Outdated
| @@ -0,0 +1,25 @@ | |||
| FROM python:2.7 | |||
| MAINTAINER Avais Pagarkar <avaispagarkar@gmail.com> | |||
There was a problem hiding this comment.
Can you please change it to CloudCV Team <team@cloudcv.org>
docker/postgres/init-user-db.sh
Outdated
| 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 |
There was a problem hiding this comment.
@deshraj how can I read the database name, user and password from the environment instead of hardcoding it?
There was a problem hiding this comment.
You can set environment variables in docker containers for this. See this https://docs.docker.com/compose/environment-variables/ for reference.
There was a problem hiding this comment.
@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; |
There was a problem hiding this comment.
@deshraj How do I read the server name from the environment instead of hardcoding it?
There was a problem hiding this comment.
Since this will be used for the production environment, you can hardcode the URL here.
No description provided.