forked from Kamva-Academy/Kamva-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:sepid-org/Manage-Content-Service in…
…to email-service
- Loading branch information
Showing
74 changed files
with
775 additions
and
745 deletions.
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 |
---|---|---|
@@ -1,31 +1,40 @@ | ||
# pull official base image | ||
# Pull official base image | ||
FROM python:3.11 | ||
|
||
# set work directory | ||
# Set work directory | ||
WORKDIR /usr/src/app | ||
|
||
# Upgrade pip | ||
RUN pip install --upgrade pip | ||
|
||
# copy requirements | ||
# Copy requirements file | ||
COPY requirements.txt /usr/src/requirements.txt | ||
|
||
# Install dependencies | ||
RUN pip install -r /usr/src/requirements.txt | ||
|
||
# copy entrypoint-prod.sh | ||
# Copy entrypoint script | ||
COPY ./entrypoint.prod.sh /usr/src/app/entrypoint.prod.sh | ||
|
||
# copy project | ||
# Copy project files | ||
COPY . /usr/src/app/ | ||
|
||
RUN adduser kamva | ||
# Create a non-root user and set permissions | ||
RUN adduser --disabled-password --gecos "" sepid && \ | ||
chown -R sepid:sepid /usr/src/app | ||
|
||
RUN mkdir -p /usr/src/app/logging && chown -R kamva /usr/src/app/logging \ | ||
&& mkdir -p /usr/src/app/staticfiles && chown -R kamva /usr/src/app/staticfiles \ | ||
&& mkdir -p /usr/src/app/media && chown -R kamva /usr/src/app/media | ||
# Create necessary directories and set permissions | ||
RUN mkdir -p /usr/src/app/logging /usr/src/app/staticfiles /usr/src/app/media && \ | ||
chown -R sepid:sepid /usr/src/app/logging /usr/src/app/staticfiles /usr/src/app/media | ||
|
||
RUN chown -R kamva /usr/src/app/ | ||
# Make the entrypoint script executable | ||
RUN chmod +x /usr/src/app/entrypoint.prod.sh | ||
|
||
USER kamva | ||
# Switch to non-root user | ||
USER sepid | ||
|
||
# run entrypoint.prod.sh | ||
ENTRYPOINT ["/usr/src/app/entrypoint.prod.sh"] | ||
# Set entrypoint | ||
ENTRYPOINT ["/usr/src/app/entrypoint.prod.sh"] | ||
|
||
# Expose port 8000 | ||
EXPOSE 8000 |
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
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
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,20 @@ | ||
from django.core.management import BaseCommand | ||
|
||
from apps.accounts.models import User, UserWebsite | ||
from apps.fsm.models import RegistrationReceipt | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
def handle(self, *args, **options): | ||
for registration_receipt in RegistrationReceipt.objects.all(): | ||
website = registration_receipt.answer_sheet_of.program.website | ||
user = registration_receipt.user | ||
try: | ||
UserWebsite.objects.create( | ||
user=user, | ||
website=website, | ||
password=user.password, | ||
) | ||
except: | ||
pass |
82 changes: 0 additions & 82 deletions
82
apps/accounts/management/commands/create_users_from_team.py
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
apps/accounts/management/commands/fix_player_workshop_history.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.