Skip to content

Commit

Permalink
Merge pull request #11 from ita-social-projects/#3-Create-Docker-File
Browse files Browse the repository at this point in the history
#3 Create Docker File
  • Loading branch information
romanmyko authored Nov 17, 2023
2 parents 80e70b9 + dd8968f commit a12252a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.9-alpine

WORKDIR /Forum
WORKDIR /Forum-Sandbox

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand All @@ -13,4 +13,4 @@ RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip3 install -r requirements.txt

COPY . /Forum
COPY . /Forum-Sandbox
43 changes: 42 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
version: ''
version: '3.9'

services:
web:
build: .
command: gunicorn forum.wsgi:application --bind 0.0.0.0:8000
volumes:
- ./:/Forum
ports:
- 8000:8000
env_file:
- sample.env
depends_on:
- db
db:
image: postgres:14
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWORD}
POSTGRES_DB: ${PG_DB}
PGDATABASE: ${PG_DB}
PGPASSWORD: ${PG_PASSWORD}
PGUSER: ${PG_USER}
ports:
- ${DB_PORT}:5432
pgadmin4:
container_name: forum_pgadmin4
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected] # your email to login at http://localhost:5050/
PGADMIN_DEFAULT_PASSWORD: 1 # your password to login at http://localhost:5050/
ports:
- "5050:80"
volumes:
- pgadmin-data:/var/lib/pgadmin/data
volumes:
db_data:
pgadmin-data:
22 changes: 11 additions & 11 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#db details
SECRET_KEY=
PG_DB=
PG_USER=
PG_PASSWORD=
DB_HOST=
DB_PORT=
SECRET_KEY= 1111
PG_DB= Forum-Sandbox
PG_USER= user
PG_PASSWORD= postgres
DB_HOST= db
DB_PORT= 5432

#SMTP
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=
EMAIL_PORT=
EMAIL_USE_TLS=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_HOST= [email protected]
EMAIL_PORT= 587
EMAIL_USE_TLS= 1
EMAIL_HOST_USER= [email protected]
EMAIL_HOST_PASSWORD= test-password

#origin hostnames allowed to make cross-site HTTP requests
CORS_ORIGIN_WHITELIST=

0 comments on commit a12252a

Please sign in to comment.