Add Dockerfile + docker-compose file
Updated env vars to reflect this change as well. Fixes: #2
This commit is contained in:
parent
fe2bf0ad46
commit
8121506c97
|
@ -0,0 +1,3 @@
|
|||
venv/
|
||||
.git
|
||||
docs
|
|
@ -0,0 +1,28 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
FROM python:3.11
|
||||
#FROM debian:stable
|
||||
#FROM ubuntu:latest
|
||||
#FROM postgres:alpine
|
||||
|
||||
#ENV POSTGRES_USER=RocksForMedia
|
||||
#ENV POSTGRES_PASSWORD=CHANGE-ME
|
||||
#ENV POSTGRES_DB=RocksForMediaDB
|
||||
|
||||
WORKDIR /RocksForMedia
|
||||
|
||||
COPY . .
|
||||
RUN export $(sed '/#/d' src/.env | xargs)
|
||||
#RUN apt update
|
||||
#RUN apt install postgresql postgresql-client postgresql-contrib git sudo -y
|
||||
#RUN apt install git -y
|
||||
RUN git config --global url.https://github.com/.insteadOf git://github.com/
|
||||
#RUN sudo -u postgres createuser -w -e $DODB_USER
|
||||
#RUN sudo -u postgres createdb --owner=$DODB_USER $DODB_NAME 'contains all the information for the RocksForMedia instance on this device'
|
||||
#RUN sudo -u postgres psql -c "ALTER USER $DODB_USER WITH PASSWORD '$DODB_PASS';"
|
||||
|
||||
RUN pip install -r src/requirements.txt
|
||||
#RUN python3 src/manage.py makemigrations
|
||||
#RUN python3 src/manage.py migrate
|
||||
#RUN python3 src/manage.py createsuperuser --noinput --email $DJANGO_SUPERUSER_EMAIL
|
||||
CMD ["python3", "src/manage.py", "runserver"]
|
||||
EXPOSE 8890
|
|
@ -105,5 +105,3 @@ The code should work with the Django development server, with some caveats:
|
|||
* Premium media will not 'play' directly without Nginx to respond to the X-Sendfile request. You'll see 200 response codes for them in the console / logs after they successfully authenticate, though.
|
||||
* There are some complex queries in the premium media RSS feeds that only work with PostgreSQL. As of this writing SQLite and MySQL do not support `distinct('field_name')` and thus will not work with this distribution in production. There is an error check against the payment app `views.py` that will allow SQLite to work in dev mode, but you must use Postgres in production and the "subscribe" page in dev mode may have duplicate entries on SQLite.
|
||||
* The code should run fine on Linux and Mac (as well as any other BSD Unix) but I don't test against Windows, so let us know if you have any Windows issues / solutions.
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
version: '3'
|
||||
services:
|
||||
rocksformedia:
|
||||
build: .
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 8890:8890
|
||||
environment:
|
||||
DJANGO_SUPERUSER_USERNAME: "admin"
|
||||
DJANGO_SUPERUSER_EMAIL: "admin@example.org"
|
||||
DJANGO_SUPERUSER_PASSWORD: "changeme"
|
||||
|
||||
database:
|
||||
image: 'postgres:alpine'
|
||||
ports:
|
||||
- 6665:5432
|
||||
environment:
|
||||
POSTGRES_USER: RocksForMedia # The PostgreSQL user (useful to connect to the database)
|
||||
POSTGRES_PASSWORD: CHANGE-ME # The PostgreSQL password (useful to connect to the database)
|
||||
POSTGRES_DB: RocksForMediaDB # The PostgreSQL default database (automatically created at first launch)
|
||||
healthcheck:
|
||||
test: "pg_isready -q -d RocksForMediaDB -U RocksForMedia"
|
||||
timeout: 45s
|
||||
interval: 10s
|
||||
retries: 10
|
||||
restart: always
|
18
src/env
18
src/env
|
@ -25,11 +25,19 @@ DOAWS_REGION=us-east1
|
|||
DOTIME_ZONE=America/Chicago
|
||||
DOSITE_NAME=YourSpiffyWebsiteName
|
||||
DOPROJECT_NAME=website
|
||||
DODB_NAME=databasename
|
||||
DODB_USER=databaseuser
|
||||
DODB_PASS=databasepassword
|
||||
DODB_HOST=
|
||||
DODB_PORT=5432
|
||||
|
||||
#Database in-code variables
|
||||
DODB_NAME=RocksForMediaDB
|
||||
DODB_USER=RocksForMedia
|
||||
DODB_PASS=CHANGE-ME
|
||||
DODB_HOST=127.0.0.1
|
||||
DODB_PORT=6665
|
||||
|
||||
#Database authentication variables
|
||||
POSTGRES_USER=RocksForMedia
|
||||
POSTGRES_PASSWORD=CHANGE-ME
|
||||
POSTGRES_DB=RocksForMediaDB
|
||||
|
||||
DOTIME_ZONES=US/Eastern,US/Central,US/Mountain,US/Arizona,US/Pacific,US/Hawaii,UTC
|
||||
DONOSEO_VIEWS=profile,unsubscribe,subscribe_switch_view,subscribe_new,subscribe_update,subscribe_checkout_session,subscribe_price_change,subscribe_canceled,subscribe_card_change_canceled,subscribe_card_change_session,subscribe_card_change_complete,subscribe_complete,subscribe_stripe_config
|
||||
DOSTRIPE_TESTPUB=pk_test_987654yourStripeTestModePublicKey
|
||||
|
|
Reference in New Issue