Dockerizing

This commit is contained in:
Elijah Lucian 2021-03-20 16:52:56 -07:00
parent a2323321e3
commit a891fa6a50
8 changed files with 94 additions and 2 deletions

19
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,19 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#ab307e",
"activityBar.activeBorder": "#25320e",
"activityBar.background": "#ab307e",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#25320e",
"activityBarBadge.foreground": "#e7e7e7",
"statusBar.background": "#832561",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#ab307e",
"titleBar.activeBackground": "#832561",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#83256199",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.remoteColor": "#832561"
}

View File

@ -2,14 +2,24 @@
An MVP boilerplate for a django / react app.
# Setup
```
python manage.py migrate
python manage.py createsuperuser --email admin@example.com --username admin --password whatever
```
# Boilerplate Features
- Authentication
- User Table (username, email, password)
# Extras
# Extras
- dockerized
# Frontend
- [x] useGet hook
- [x] User context
- [x] auth api
@ -17,6 +27,7 @@ An MVP boilerplate for a django / react app.
- [ ] socket hook
# Backend
- user CRUD
- login / logout / forgot password
- serve static index (prod)
- serve static index (prod)

22
docker-compose.yml Normal file
View File

@ -0,0 +1,22 @@
version: "3.8"
services:
frontend:
build:
context: ./frontend
volumes:
- ./frontend/src:/usr/src/frontend/src
ports:
- 3000:3000
environment:
CHOKIDAR_USEPOLLING: "true"
command: ["npm", "run", "start"]
server:
build:
context: ./server
volumes:
- ./server:/usr/src/server
ports:
- 8000:8000
command: ["python", "manage.py", "runserver"]

1
frontend/.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

19
frontend/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,19 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#1f6fd0",
"activityBar.activeBorder": "#ee90bb",
"activityBar.background": "#1f6fd0",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#ee90bb",
"activityBarBadge.foreground": "#15202b",
"statusBar.background": "#1857a4",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#1f6fd0",
"titleBar.activeBackground": "#1857a4",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#1857a499",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.remoteColor": "#1857a4"
}

9
frontend/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:14
WORKDIR /usr/src/frontend
COPY . .
RUN npm i
EXPOSE 3000

9
server/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:3
WORKDIR /usr/src/server
COPY . .
RUN pip install -r requirements.txt
EXPOSE 8000

2
server/setup.sh Executable file
View File

@ -0,0 +1,2 @@
python manage.py migrate
python manage.py createsuperuser --email admin@example.com --username admin