Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions game_project/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Projenin spesifik olarak beklediği ya da sorun çıkardığı bir Python sürümü var mı?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valla tam emin değilim ama 3 olsun demiştim


ENV PYTHONUNBUFFERED 1

RUN mkdir /game_project

WORKDIR /game_project

COPY requirements-phase1.txt /game_project/
RUN pip install -r requirements-phase1.txt

COPY kanarya_config.json /etc/

COPY . /game_project/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunu komple kopyalamak yerine volume olarak bağlasak, yeniden derlemeden güncelleme şansı olur.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

olabilir bakarız


COPY requirements-phase2.txt /game_project/
RUN pip install -r requirements-phase2.txt

RUN python manage.py migrate --noinput
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ben bunu dışarıdan kullanıcıya bırakmayı tercih ediyorum. Otomatik yapınca, yayına alma ya da farklı kullanıcıların farklı branchlerde farklı migrationlarla çalışma durumlarına beklenmedik sonuçlar çıkabiliyor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrate'i mi diyorsun?


# RUN python manage.py createsuperuser
# Run with docker exec -it ${container_name} python manage.py createsuperuser
17 changes: 17 additions & 0 deletions game_project/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
db:
image: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/game_project
ports:
- "8000:8000"
depends_on:
- db
4 changes: 3 additions & 1 deletion game_project/game_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import json
from django.contrib.messages import constants as messages

with open('/etc/kanarya_config.json') as config_file:
config_filepath = '/etc/kanarya_config.json'

with open(config_filepath) as config_file:
config = json.load(config_file)

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
Expand Down
5 changes: 5 additions & 0 deletions game_project/kanarya_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"SECRET_KEY": "loremipsum",
"EMAIL_USER": "username",
"EMAIL_PASS": "password"
}
1 change: 1 addition & 0 deletions game_project/requirements-phase1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
torch>=1.1.0
48 changes: 48 additions & 0 deletions game_project/requirements-phase2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# asgiref==3.2.7
# boto==2.49.0
# boto3==1.13.11
# botocore==1.16.11
# bpemb==0.3.0
# certifi==2020.4.5.1
# chardet==3.0.4
# cloudpickle==1.4.1
# cycler==0.10.0
# decorator==4.4.2
# Deprecated==1.2.10
Django==3.0.5
django-crispy-forms==1.9.0
# docutils==0.15.2
flair==0.4.1
# future==0.18.2
# gensim==3.8.3
# hyperopt==0.2.4
# idna==2.9
# jmespath==0.10.0
# joblib==0.15.1
# kiwisolver==1.2.0
# matplotlib==3.2.1
# mpld3==0.3
# networkx==2.4
# numpy==1.18.4
Pillow==7.1.1
# psutil==5.7.0
# pyparsing==2.4.7
# python-dateutil==2.8.1
# pytorch-pretrained-bert==0.6.2
# pytz==2019.3
# regex==2018.1.10
# requests==2.23.0
# s3transfer==0.3.3
# scikit-learn==0.23.0
# scipy==1.4.1
# segtok==1.5.10
# sentencepiece==0.1.90
# six==1.14.0
# sklearn==0.0
# smart-open==2.0.0
# sqlitedict==1.6.0
# sqlparse==0.3.1
# threadpoolctl==2.0.0
# tqdm==4.46.0
# urllib3==1.25.9
# wrapt==1.12.1
47 changes: 1 addition & 46 deletions game_project/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,4 @@
asgiref==3.2.7
boto==2.49.0
boto3==1.13.11
botocore==1.16.11
bpemb==0.3.0
certifi==2020.4.5.1
chardet==3.0.4
cloudpickle==1.4.1
cycler==0.10.0
decorator==4.4.2
Deprecated==1.2.10
Django==3.0.5
django-crispy-forms==1.9.0
docutils==0.15.2
flair==0.4.1
future==0.18.2
gensim==3.8.3
hyperopt==0.2.4
idna==2.9
jmespath==0.10.0
joblib==0.15.1
kiwisolver==1.2.0
matplotlib==3.2.1
mpld3==0.3
networkx==2.4
numpy==1.18.4
Pillow==7.1.1
psutil==5.7.0
pyparsing==2.4.7
python-dateutil==2.8.1
pytorch-pretrained-bert==0.6.2
pytz==2019.3
regex==2018.1.10
requests==2.23.0
s3transfer==0.3.3
scikit-learn==0.23.0
scipy==1.4.1
segtok==1.5.10
sentencepiece==0.1.90
six==1.14.0
sklearn==0.0
smart-open==2.0.0
sqlitedict==1.6.0
sqlparse==0.3.1
threadpoolctl==2.0.0
torch==1.1.0
tqdm==4.46.0
urllib3==1.25.9
wrapt==1.12.1
Pillow==7.1.1
Empty file.