-
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.
- Loading branch information
1 parent
ad228d7
commit 753bbb8
Showing
6 changed files
with
111 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
DJANGO_DEBUG=False # if in development ode | ||
DJANGO_ADMIN_URL="admin/" # admin url | ||
DJANGO_ALLOWED_HOSTS=["0.0.0.0"] #hosts allowe to render your app | ||
DJANGO_SETTINGS_MODULE=config.settings.local #if in development else change local to production | ||
DJANGO_SECRET_KEY="" | ||
DJANGO_SECURE_SSL_REDIRECT=False # to prevent http to be redirected to https while you don't have ssl | ||
|
||
CELERY_BROKER_URL=redis://localhost:6379/0 | ||
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP=True | ||
|
||
REDIS_URL=redis://localhost:6379/0 | ||
|
||
AUTH_GITHUB_ID="" | ||
AUTH_GITHUB_SECRET="" | ||
|
||
APP_JWT_SIGNING_KEY="" |
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,13 +1,18 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.11.6 | ||
|
||
ARG REQUIREMENTS_FILE | ||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
EXPOSE 8000 | ||
# Copy the requirements files before copying the rest of the application | ||
COPY ./requirements/ ./requirements | ||
|
||
CMD "gunicorn --bind 0.0.0.0:8000 -w 4 --limit-request-line 6094 --access-logfile - config.wsgi:application" | ||
# Install dependencies | ||
RUN pip install -r ./requirements/production.txt && \ | ||
pip install -r ./requirements/extra.txt | ||
|
||
COPY ./requirements/ ./requirements | ||
RUN pip install -r ./requirements/production.txt | ||
RUN pip install -r ./requirements/extra.txt | ||
# Copy the rest of the application code to the working directory | ||
COPY . /app/ | ||
|
||
COPY . ./ | ||
# Inform Docker that the container listens on the specified port | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Ensure script is run with elevated privileges | ||
if [ "$(id -u)" != "0" ]; then | ||
echo "This script must be run as root. Try using sudo." | ||
exit 1 | ||
fi | ||
|
||
# Stop all running containers | ||
docker stop $(docker ps -q) | ||
|
||
# Remove all containers (including stopped ones) | ||
docker rm $(docker ps -a -q) | ||
|
||
# Remove all Docker images | ||
docker rmi $(docker images -q) | ||
|
||
# Remove dangling images | ||
docker image prune -f | ||
|
||
echo "All Docker containers and images have been removed." |
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 |
---|---|---|
@@ -1,6 +1,39 @@ | ||
FROM node:21.7.3 | ||
COPY package.json pnpm-lock.yaml* ./ | ||
RUN corepack enable pnpm && pnpm install | ||
RUN corepack enable pnpm && pnpm run build | ||
# Stage 1: Build the application | ||
FROM node:21.7.3 AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package management files first for caching | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Install dependencies using pnpm | ||
RUN npm install -g pnpm \ | ||
&& pnpm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
RUN corepack enable pnpm && pnpm start | ||
|
||
# Build the Next.js application | ||
RUN pnpm run build | ||
|
||
# Stage 2: Run the application | ||
FROM node:21.7.3 AS runner | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy the built application from the builder stage | ||
COPY --from=builder /app ./ | ||
|
||
# Install only production dependencies | ||
RUN pnpm install --prod | ||
|
||
# Expose the port Next.js will run on | ||
EXPOSE 3000 | ||
|
||
# Command to run the application | ||
CMD ["pnpm", "start"] |
753bbb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jeezy – ./
jeezy-git-main-iranzi-thierrys-projects.vercel.app
jeezy-iranzi-thierrys-projects.vercel.app
jeezy.vercel.app