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

Clean PR of Docker Logic #84

Merged
merged 8 commits into from
May 6, 2020
Merged
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
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.git
.vscode

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
pip3 install pipenv
cd back-end
pipenv install
pipenv run echo "SECRET_KEY='TEMPORARY SECRET KEY'" > vp/.environment
Expand Down Expand Up @@ -61,4 +62,3 @@ jobs:
with:
collection: Postman/Visual\ Programming-Tests.postman_collection.json
environment: Postman/Local\ Testing.postman_environment.json

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions back-end/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.8

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/ ./vp
RUN echo "SECRET_KEY=tmp" > vp/.environment

EXPOSE 8000

WORKDIR /visual-programming/back-end/vp

CMD pipenv run python manage.py runserver 0.0.0.0:8000
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions vp/vp/settings.py → back-end/vp/vp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['back-end:8000',
'back-end',
'localhost',
'127.0.0.1',
'0.0.0.0',
'[::1]']


# Application definition
Expand Down Expand Up @@ -81,7 +86,7 @@

# 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.
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.3"
services:
back-end:
build: ./back-end
ports:
- "8000:8000"
command: bash -c "pipenv run python manage.py runserver 0.0.0.0:8000"
environment:
- DJANGO_ENV=development
front-end:
build: ./front-end
stdin_open: true
ports:
- "3000:3000"
environment:
- NODE_ENV=development
depends_on:
- back-end
links:
- back-end
command: npm start
14 changes: 14 additions & 0 deletions front-end/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14-alpine

WORKDIR /visual-programming/front-end

COPY package.json .

RUN npm install

COPY src/ ./src/
COPY public/ ./public/

EXPOSE 3000

CMD npm start
2 changes: 1 addition & 1 deletion front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"last 1 safari version"
]
},
"proxy": "http://localhost:8000",
"proxy": "http://back-end:8000",
"devDependencies": {
"@babel/preset-env": "^7.9.5",
"@babel/preset-react": "^7.9.4",
Expand Down
Empty file removed vp/db.sqlite3
Empty file.