This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
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 #232 from OpenDataPolicingNC/docker-setup
Docker setup
- Loading branch information
Showing
21 changed files
with
708 additions
and
107 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,45 @@ | ||
FROM python:3.4 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Install packages for postgres, python dev for some project packages, and rsync for some fabric commands: | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
binutils \ | ||
postgresql-client \ | ||
rsync \ | ||
gdal-bin | ||
|
||
# Fabric for deploys: | ||
RUN pip install -U pip | ||
RUN pip install PyYAML fabric3 paramiko pycrypto ecdsa | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
|
||
ADD requirements /code/requirements | ||
RUN pip install -r requirements/dev.txt | ||
|
||
# nvm environment variables | ||
ENV NVM_DIR /usr/local/nvm | ||
RUN mkdir -p $NVM_DIR | ||
ENV NODE_VERSION 6.14.4 | ||
|
||
# install nvm | ||
# https://github.com/creationix/nvm#install-script | ||
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | ||
|
||
# install node and npm | ||
RUN . $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default | ||
|
||
# add node and npm to path so the commands are available | ||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules | ||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
|
||
# confirm installation | ||
RUN node -v | ||
RUN npm -v | ||
|
||
RUN npm install -g gulp |
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,33 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
image: mdillon/postgis:9.4-alpine | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
web: | ||
build: . | ||
command: npm run dev -- --address=0.0.0.0 --port=8000 | ||
environment: | ||
DJANGO_SETTINGS_MODULE: traffic_stops.settings.local | ||
PGDATABASE: traffic_stops | ||
PGUSER: postgres | ||
PGHOST: db | ||
DATABASE_URL: postgis://postgres@db:5432/traffic_stops | ||
DATABASE_URL_NC: postgis://postgres@db:5432/traffic_stops_nc | ||
DATABASE_URL_MD: postgis://postgres@db:5432/traffic_stops_md | ||
DATABASE_URL_IL: postgis://postgres@db:5432/traffic_stops_il | ||
VIRTUAL_ENV: /usr/local # gulpfile expects Python to be in a virtualenv | ||
volumes: | ||
# mount local repository into the container | ||
- .:/code:delegated | ||
# If the developer wants to deploy inside a docker container, expose their | ||
# SSH keys to the container: | ||
- ~/.ssh:/root/.ssh | ||
ports: | ||
- "8003:8000" | ||
depends_on: | ||
- db | ||
|
||
volumes: | ||
pgdata: |
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
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
Oops, something went wrong.