-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from geometalab/dockerize
Dockerize
- Loading branch information
Showing
7 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.git/ | ||
.gitignore | ||
Dockerfile | ||
docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ config_local.py | |
*.backup | ||
*.sql | ||
*.gz | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:2 | ||
|
||
LABEL maintainer="Geometalab <[email protected]>" | ||
|
||
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* | ||
|
||
ENV DOCKERIZE_VERSION v0.6.1 | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
RUN pip install uwsgi psycopg2-binary | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
EXPOSE 8080 | ||
|
||
COPY . /opt/cf_audit | ||
WORKDIR /opt/cf_audit | ||
ENTRYPOINT [ "dockerize", "-wait", "tcp://database:5432" ] | ||
CMD [ "uwsgi", "--chdir", "/opt/cf_audit/", "--http", ":8080", "--wsgi-file", "cf_audit.wsgi" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3.4' | ||
services: | ||
cf-audit: &auditor | ||
build: . | ||
environment: | ||
# uncomment following line to enable debugging | ||
# DEBUG: yes | ||
DATABASE_URI: 'postgresql://cf_audit:pw@database:5432/cf_audit' | ||
# enter the osm-ids here, which should get admin-rights. | ||
ADMINS: '' | ||
env_file: | ||
- .env | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- database | ||
migrate: | ||
<<: *auditor | ||
command: python migrate.py | ||
ports: [] | ||
database: | ||
image: postgres:10 | ||
environment: | ||
POSTGRES_USER: cf_audit | ||
POSTGRES_PASSWORD: pw | ||
POSTGRES_DB: cf_audit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env python2 | ||
from www.db import migrate | ||
migrate() |