Skip to content

Commit

Permalink
Get static files working on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbelesky committed Feb 5, 2017
1 parent cb17ca8 commit 3571403
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ WORKDIR /tcd
ADD . /tcd/

# Install our node/python requirements
RUN pip install -r ./requirements_common.txt && npm install
RUN pip install -r ./requirements_common.txt
RUN npm install

# Compile all the static files
RUN npm rebuild node-sass
RUN python ./tabbycat/manage.py collectstatic --no-input
RUN python ./tabbycat/manage.py collectstatic --no-input
6 changes: 6 additions & 0 deletions bin/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env bash
# Shorthand to migrate and runserver in docker

# Move up to where we can run commands
cd tabbycat

# Migrate (can't do it during build; no db connnection)
python ./manage.py migrate --no-input

# Run the server
# python ./manage.py runserver 0.0.0.0:8000
waitress-serve --threads=12 --host=0.0.0.0 --port=8000 wsgi:application
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ services:
command: ["./bin/docker-wait.sh", "db:5432", "--", "./bin/docker-run.sh"]
depends_on:
- db
expose:
- "8000"
environment:
- DEBUG=1
- IN_DOCKER=1
Expand All @@ -33,5 +35,7 @@ services:
- "8000:8000"
volumes:
- .:/tcd
- node_modules:/tcd/node_modules
volumes:
pgdata:
node_modules:
4 changes: 2 additions & 2 deletions docs/install/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ Docker offers a installer for Windows and OSX. Go to the relevant page linked be

3. A terminal window should popup and bunch of text scroll by. If this is your first time running Docker it may take up to half an hour to download and setup the virtul machine.

4. Once the new text stops being added you should be able to go to a web and open up http://0.0.0.0:8000 and see your new Tabbycat website.
4. Once the new text stops being added you should be able to go to a web and open up http://localhost:8000/ (Windows) or http://0.0.0.0:8000 (OSX/Linux) and see your new Tabbycat website.

.. note:: If you want to reopen Tabbycat at a later time (say after restarting) repeat steps 1 through 3 here.
.. note:: If you want to reopen Tabbycat at a later time (say after restarting) repeat steps 1 through 3 here.

0 comments on commit 3571403

Please sign in to comment.