-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from marudhu2004/add_docker
Adding docker to the project
- Loading branch information
Showing
10 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.git | ||
.circleci | ||
.github | ||
env | ||
conf | ||
conf_template | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ __pycache__/ | |
.vscode/ | ||
Logfile | ||
Logfile.log | ||
conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
copy the folder named "conf_template" and name it "conf". | ||
update the env files under conf with your keys. | ||
run "docker compose up -d --build" to run the project. | ||
wait for a minute and restart any container that stops. | ||
|
||
additional: | ||
login in to pgadmin and connect to the database server. | ||
for the host name use local_pgdb. | ||
|
||
Note: | ||
please run "docker compose up -d --build" when you update environment variables. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:18.04 | ||
|
||
# Installing python | ||
RUN apt-get update | ||
RUN apt-get install -y libpq-dev | ||
RUN apt-get install -y python3-dev | ||
RUN apt-get install -y python3-pip | ||
RUN apt-get clean | ||
|
||
RUN python3 -m pip install --upgrade pip | ||
RUN python3 -m pip install --upgrade pillow | ||
|
||
WORKDIR /saythanks | ||
|
||
# Installing requirements | ||
COPY ./requirements.txt . | ||
RUN python3 -m pip install -r requirements.txt | ||
|
||
# Copying the app | ||
COPY . . | ||
|
||
EXPOSE 5000 | ||
CMD [ "python3", "t.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
POSTGRES_DB=saythanks | ||
POSTGRES_USER=user-name | ||
POSTGRES_PASSWORD=strong-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PGADMIN_DEFAULT_EMAIL=[email protected] | ||
PGADMIN_DEFAULT_PASSWORD=strong-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DATABASE_URL='postgresql://user-name:strong-password@your-IP-addr/saythanks' | ||
SENDGRID_API_KEY='' | ||
AUTH0_CLIENT_ID='' | ||
AUTH0_CLIENT_SECRET='' | ||
AUTH0_CALLBACK_URL='http://localhost:5000/callback' | ||
AUTH0_DOMAIN='' | ||
AUTH0_JWT_V2_TOKEN='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: "3.8" | ||
services: | ||
|
||
site: | ||
build: . | ||
ports: | ||
- 5000:5000 | ||
env_file: | ||
- ./conf/site.env | ||
volumes: | ||
- ./:/saythanks | ||
depends_on: | ||
- db | ||
|
||
db: | ||
image: postgres | ||
container_name: local_pgdb | ||
restart: always | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- ./conf/db.env | ||
volumes: | ||
- local_pgdata:/var/lib/postgresql/data | ||
- ./saythanks/sqls/schema.sql:/docker-entrypoint-initdb.d/schema.sql | ||
networks: | ||
- saythanks | ||
|
||
pgadmin: | ||
image: dpage/pgadmin4 | ||
container_name: pgadmin4_container | ||
restart: always | ||
ports: | ||
- "8888:80" | ||
env_file: | ||
- ./conf/pgadmin.env | ||
|
||
volumes: | ||
- pgadmin-data:/var/lib/pgadmin | ||
|
||
networks: | ||
- saythanks | ||
|
||
volumes: | ||
local_pgdata: | ||
pgadmin-data: | ||
|
||
networks: | ||
saythanks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
appdirs | ||
auth0-python<=2 | ||
blinker | ||
click | ||
colorama | ||
contextlib2 | ||
crayons | ||
dateparser | ||
docopt | ||
flake8 | ||
flask | ||
flask-qrcode | ||
gunicorn | ||
humanize | ||
itsdangerous | ||
jinja2 | ||
lxml | ||
markupsafe | ||
maya | ||
names | ||
ordereddict | ||
packaging | ||
pendulum | ||
psycopg2 | ||
pyjwt | ||
pyment | ||
pytest | ||
pyparsing | ||
pytest-cov | ||
python-dateutil | ||
python-http-client | ||
pytz | ||
pytzdata | ||
raven | ||
regex | ||
requests | ||
ruamel.yaml | ||
sendgrid | ||
six | ||
sqlalchemy | ||
tablib | ||
tzlocal | ||
werkzeug | ||
whitenoise | ||
python-dotenv | ||
markdown | ||
flask_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters