Skip to content

Commit

Permalink
Fix #3 Configuration of dockerfile for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
stariluz committed Jun 24, 2024
1 parent 6a019a5 commit 22eda67
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv
media
static
environment/*
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.12.4

WORKDIR /app

COPY . .

RUN python -m pip install --user pipx
RUN python -m pipx ensurepath
RUN python -m pipx install poetry
RUN python -m pipx run poetry install

EXPOSE 8000
# CMD sh
CMD python -m pipx run poetry run daphne myFacegram.asgi:application -b 0.0.0.0 -p 8000
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ pipx uninstall poetry
```

### In initialized proyects
```sh
poetry init
```

## Docker
```sh
docker run -dti -p8000:8000 --name my-facegram --env-file ./environment/.env.production poetry-django
```
6 changes: 6 additions & 0 deletions environment/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SECRET_KEY=$SECRET_KEY
AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
AWS_STORAGE_BUCKET_NAME=$AWS_STORAGE_BUCKET_NAME
PROD_HOST=$PROD_HOST
1 change: 1 addition & 0 deletions myFacegram/settings_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
os.environ["PROD_HOST"]
]


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.0.6 on 2024-06-24 18:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0013_auto_20201026_1925'),
]

operations = [
migrations.AlterField(
model_name='profile',
name='birthday',
field=models.IntegerField(blank=True, default='0', unique_for_date=True),
),
migrations.AlterField(
model_name='profile',
name='birthmonth',
field=models.IntegerField(blank=True, default='0', unique_for_month=True),
),
migrations.AlterField(
model_name='profile',
name='birthyear',
field=models.IntegerField(blank=True, default='0', unique_for_year=True),
),
]

0 comments on commit 22eda67

Please sign in to comment.