Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wugsy
app
Commits
d6ca0a90
Commit
d6ca0a90
authored
Jan 17, 2018
by
danny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dockerised!
parent
536e93f4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
16 deletions
+39
-16
Dockerfile
Dockerfile
+1
-0
docker-compose.yml
docker-compose.yml
+19
-11
base.txt
requirements/base.txt
+3
-1
decide.py
src/wugsy/decide.py
+2
-1
base.py
src/wugsy/settings/base.py
+3
-2
urls.py
src/wugsy/urls.py
+1
-1
start.sh
start.sh
+10
-0
No files found.
Dockerfile
View file @
d6ca0a90
...
...
@@ -3,5 +3,6 @@ ENV PYTHONUNBUFFERED 1
RUN
mkdir /code
WORKDIR
/code
ADD
requirements.txt /code/
ADD
requirements /code/requirements
RUN
pip install
-r
requirements.txt
ADD
. /code/
docker-compose.yml
View file @
d6ca0a90
version
:
'
3'
services
:
db
:
image
:
mysql
web
:
build
:
.
command
:
python3 manage.py runserver 0.0.0.0:8000
volumes
:
-
.:/code
ports
:
-
"
8000:8000"
depends_on
:
-
db
db
:
environment
:
MYSQL_DATABASE
:
db
MYSQL_PASSWORD
:
password
MYSQL_ROOT_PASSWORD
:
password
MYSQL_USER
:
root
image
:
mysql:latest
ports
:
-
3306:3306
web
:
image
:
wugsy:latest
build
:
.
command
:
python3 src/manage.py runserver 0.0.0.0:8000
volumes
:
-
.:/code
ports
:
-
"
8000:8000"
depends_on
:
-
db
requirements/base.txt
View file @
d6ca0a90
Django
>
=1.11.3
Django
=
=1.11.3
django-environ>=0.4.3
django-braces>=1.11.0
django-crispy-forms>=1.6.1
django-admin-bootstrapped>=2.5.7
django-authtools>=1.6.0
easy-thumbnails>=2.4.1
djangorestframework
psycopg2
mysqlclient
src/wugsy/decide.py
View file @
d6ca0a90
...
...
@@ -35,7 +35,8 @@ class DecideGame(object):
return
0
def
_get_title
(
self
):
return
'Prototype game {} for {}'
.
format
(
self
.
_nonce
,
self
.
user
.
name
)
username
=
getattr
(
self
.
user
,
'name'
,
'anonymous user'
)
return
'Prototype game {} for {}'
.
format
(
self
.
_nonce
,
username
)
def
_get_opponent
(
self
):
return
dict
(
id
=
78
,
...
...
src/wugsy/settings/base.py
View file @
d6ca0a90
...
...
@@ -102,9 +102,10 @@ DATABASES = {
'default'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
'mysql'
,
'USER'
:
'mysql'
,
'USER'
:
'root'
,
'PASSWORD'
:
'password'
,
'HOST'
:
'db'
,
'PORT'
:
5432
,
'PORT'
:
3306
,
}
}
...
...
src/wugsy/urls.py
View file @
d6ca0a90
...
...
@@ -5,7 +5,7 @@ from django.conf.urls.static import static
import
profiles.urls
import
accounts.urls
from
.
import
views
from
game.views
import
GamePage
,
generate_data
from
game.views
import
GamePage
,
generate_data
,
game_result
urlpatterns
=
[
url
(
r'^$'
,
views
.
HomePage
.
as_view
(),
name
=
'home'
),
...
...
start.sh
0 → 100755
View file @
d6ca0a90
#!/usr/bin/env bash
# quick script to create and run docker image, with db migrations
docker-compose build
docker-compose up
-d
sleep 5
docker
exec
-it
wugsy_web_1 python3 src/manage.py makemigrations
docker
exec
-it
wugsy_web_1 python3 src/manage.py migrate
echo
"Ready! Navigate to http://localhost:8000"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment