Skip to content

Commit

Permalink
Update docker configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed Sep 25, 2023
1 parent 4fba09c commit 51e6e2d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .idea/anitrend-relations-py.iml → .idea/anitrend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ RUN mkdir tmp
# Stage 2: Django Server stage
FROM builder AS django-server

# Run Django's migrations
RUN python manage.py migrate

# Expose the port your Django app will run on
EXPOSE 8800

# Start Django server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8800"]
CMD start-server.sh

# Stage 3: Django Q Cluster stage
FROM builder AS django-q-cluster

# Start Django Q scheduler and worker
CMD ["python", "manage.py", "qcluster"]
CMD start-q.sh
2 changes: 1 addition & 1 deletion app/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .common import *

ALLOWED_HOSTS = ["anitrend.co"]
ALLOWED_HOSTS = ["graphql.anitrend.co"]

DATABASES = {
"default": {
Expand Down
5 changes: 0 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ services:
dockerfile: Dockerfile
networks:
- traefik-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.django-q-cluster.rule=Host(`${DOMAIN}`) && Path(`/q/`)"
- "traefik.http.routers.django-q-cluster.entrypoints=web"
- "traefik.http.services.django-q-cluster.loadbalancer.server.port=8800"
depends_on:
- db

Expand Down
6 changes: 6 additions & 0 deletions start-q.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

echo "Setting running migrations"
python manage.py migrate
echo "Starting qcluster"
python manage.py qcluster
6 changes: 6 additions & 0 deletions start-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

echo "Setting running migrations"
python manage.py migrate
echo "Starting server"
python manage.py runserver 0.0.0.0:8800

0 comments on commit 51e6e2d

Please sign in to comment.