forked from TabbycatDebate/tabbycat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a03e29
commit 573891c
Showing
4 changed files
with
68 additions
and
3 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 |
---|---|---|
|
@@ -24,6 +24,9 @@ data/* | |
!data/presets/ | ||
!data/fixtures/ | ||
|
||
# Docker | ||
dbdata | ||
|
||
# Docs | ||
docs/site/ | ||
issues-*.html | ||
|
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,35 @@ | ||
# Docker file lists all the commands needed to setup a fresh linux instance to | ||
# run the application specified. docker-compose does not use this. | ||
|
||
# Grab a python image | ||
FROM python:3.6 | ||
|
||
# Just needed for all things python | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Setup Node/NPM | ||
RUN apt-get update && apt-get install curl | ||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash | ||
RUN apt-get install -y nodejs | ||
|
||
# Copy all our files into the baseimage and cd to that directory | ||
RUN mkdir /tcd | ||
WORKDIR /tcd | ||
ADD . /tcd/ # Can this be skipped? Takes ages | ||
COPY ./tabbycat/local_settings.example /tcd/tabbycat/local_settings.py | ||
|
||
# Install our python requirements | ||
RUN pip install -r ./requirements_common.txt | ||
|
||
# Install our node requirements | ||
RUN npm install | ||
|
||
# This needs to happen else sass gets angry | ||
RUN npm rebuild node-sass | ||
|
||
# Migrate our database | ||
# RUN python ./tabbycat/manage.py migrate --noinput | ||
|
||
# Run server | ||
EXPOSE 8000 | ||
# RUN python ./tabbycat/manage.py runserver |
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 @@ | ||
# Docker-compose is a way to run multiple containers at once and connect them | ||
# This sets up and runs postgres, the django dev server | ||
|
||
# Initial setup with | ||
# $ docker-compose up | ||
# Can run management commands with | ||
# $ docker-compose run web /code/manage.py whatever | ||
|
||
version: '2' | ||
services: | ||
db: | ||
image: postgres | ||
environment: | ||
POSTGRES_PASSWORD: password | ||
volumes: | ||
- ./dbdata:/var/lib/postgresql/data | ||
web: | ||
# Hack to wait until Postgres is up before running things | ||
command: bash -c "while ! nc -w 1 -z db 5432; do sleep 0.1; done; ./tabbycat/manage.py migrate; while :; do ./tabbycat/manage.py runserver_plus 0.0.0.0:8000; sleep 1; done" | ||
image: django | ||
build: . | ||
volumes: | ||
- .:/code | ||
depends_on: | ||
- db | ||
environment: | ||
IN_DOCKER: 1 |
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