Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Configuring settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-Yamasaki committed Apr 13, 2022
1 parent 26dd43c commit 47907fc
Show file tree
Hide file tree
Showing 13 changed files with 559 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG VARIANT="3.10-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

RUN sudo apt update
RUN sudo apt install postgresql -y && \
sudo service postgresql start && \
sudo -u postgres psql -c "CREATE USER vscode WITH PASSWORD 'c04e05b8-8fd1-4b20-96ed-6f0cb0ed40a2';" && \
sudo -u postgres psql -c "CREATE USER mealizedev WITH PASSWORD '6498fed5-8d49-4a85-82ee-03230c500fc6';" && \
sudo -u postgres psql -c "ALTER USER vscode WITH SUPERUSER;" && \
sudo -u postgres psql -c "CREATE DATABASE vscode WITH OWNER vscode" && \
sudo -u postgres psql -c "CREATE DATABASE mealize WITH OWNER mealizedev"

ENV DATABASE_URL=postgresql://mealizedev:6498fed5-8d49-4a85-82ee-03230c500fc6@localhost/mealize
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Useful links:
// https://aka.ms/devcontainer.json
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/python-3
// https://aka.ms/vscode-remote/containers/non-root

{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.9",
"NODE_VERSION": "16"
}
},
"settings": {
},
"extensions": [
],
"forwardPorts": [5000, 5432, 3000],
"postCreateCommand": "pipenv install --dev && cd reactApp && npm install",
"postStartCommand": "sudo service postgresql start",
"remoteUser": "vscode"
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added .env
Empty file.
Empty file added .env.example
Empty file.
Empty file added .flaskenv
Empty file.
Empty file added .gitignore
Empty file.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.9

ENV REACT_APP_BASE_URL=https://mealize.herokuapp.com/
ENV FLASK_APP=app
ENV FLASK_ENV=production
ENV SQLALCHEMY_ECHO=true

WORKDIR /var/www

COPY . .

COPY /reactApp/build/* app/static

RUN pip install -r requirements.txt
RUN pip install psycopg2

CMD gunicorn app:app
39 changes: 39 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[[source]]
url="https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
click = "==7.1.2"
gunicorn = "==20.1.0"
itsdangerous = "==2.0.1"
python-dotenv = "==0.14.0"
six = "==1.15.0"
Flask = "==2.0.1"
Flask-Cors = "==3.0.8"
Flask-SQLAlchemy = "==2.5.1"
Flask-WTF = "==0.15.1"
Jinja2 = "==3.0.1"
MarkupSafe = "==2.0.1"
SQLAlchemy = "==1.4.19"
Werkzeug = "==2.0.1"
WTForms = "==2.3.3"
Flask-Migrate = "==3.0.1"
Flask-Login = "==0.5.0"
alembic = "==1.6.5"
python-dateutil = "==2.8.1"
python-editor = "==1.0.4"
greenlet = "==1.1.0"
Mako = "==1.1.4"
email-validator = "==1.1.3"
validators = "*"
Faker = "==13.3.4"
dnspython = "==2.2.1"
idna = "==3.3"

[dev-packages]
psycopg2-binary = "==2.8.6"

[requires]
python_version = "3.9"

432 changes: 432 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

Empty file added README.md
Empty file.
2 changes: 2 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
psycopg2-binary==2.8.6

28 changes: 28 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-i https://pypi.org/simple
alembic==1.6.5
click==7.1.2
dnspython==2.2.1; python_version >= '3.6' and python_version < '4.0'
email-validator==1.1.3
faker==13.3.4
flask-cors==3.0.8
flask-login==0.5.0
flask-migrate==3.0.1
flask-sqlalchemy==2.5.1
flask-wtf==0.15.1
flask==2.0.1
greenlet==1.1.0
gunicorn==20.1.0
idna==3.3; python_version >= '3.5'
itsdangerous==2.0.1
jinja2==3.0.1
mako==1.1.4
markupsafe==2.0.1
python-dateutil==2.8.1
python-dotenv==0.14.0
python-editor==1.0.4
setuptools==62.0.0; python_version >= '3.7'
six==1.15.0
sqlalchemy==1.4.19
werkzeug==2.0.1
wtforms==2.3.3

0 comments on commit 47907fc

Please sign in to comment.