Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Docker containers #75

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions back-end/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.8.2

WORKDIR /visual-programming/back-end

COPY Pipfile Pipfile.lock ./
COPY CLI/ ./CLI/
COPY pyworkflow/ ./pyworkflow/

RUN pip install pipenv
RUN pipenv install --dev --ignore-pipfile

COPY . ./vp/
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved

EXPOSE 8000

matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /visual-programming/back-end/vp

CMD pipenv run manage.py runserver 0.0.0.0:8000
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions Pipfile → back-end/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ django = "~=3.0.4"
pandas = "~=1.0.1"
python-dotenv = "~=0.12.0"
networkx = "~=2.4"
pyworkflow = {path = "./pyworkflow",editable = true}
pyworkflow = {path = "./pyworkflow", editable = true}
djangorestframework = "*"
drf-yasg = "*"
click = "*"
cli = {path = "./CLI",editable = true}
cli = {path = "./CLI", editable = true}

[requires]
python_version = "3.8"
python_version = "3.8.2"
4 changes: 2 additions & 2 deletions Pipfile.lock → back-end/Pipfile.lock

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

File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions vp/manage.py → back-end/vp/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
import os
import sys

import dotenv


def main():
dotenv.load_dotenv(".environment")
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vp.settings')
try:
from django.core.management import execute_from_command_line
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions vp/vp/settings.py → back-end/vp/vp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@

SESSION_ENGINE = 'django.contrib.sessions.backends.file'

matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
WSGI_APPLICATION = 'vp.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
### Not yet setup
# Not yet setup
DATABASES = {}

MEDIA_ROOT = '/tmp'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.8"
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
services:
back-end:
build: ./back-end
volumes:
- ./backend:/visual-programming/back-end
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
ports:
- "8000:8000"
env_file: ./backend/.env
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
stdin_open: true
tty: true
command: cd vp && pipenv run python manage.py runserver 0.0.0.0:8000
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
front-end:
build: ./front-end
volumes:
- ./front-end:/visual-programming/front-end
# One-way volume to use node_modules from inside image
- /visual-programming/front-end/node_modules
ports:
- "3000:3000"
environment:
- NODE_ENV=development
depends_on:
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved
- back-end
command: npm start
13 changes: 13 additions & 0 deletions front-end/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:current-slim

WORKDIR /visual-programming/front-end

COPY package.json .

RUN npm install

COPY . .
matthew-t-smith marked this conversation as resolved.
Show resolved Hide resolved

EXPOSE 3000

CMD npm start
Empty file removed vp/db.sqlite3
Empty file.