generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Showing
2 changed files
with
97 additions
and
0 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,34 @@ | ||
name: deploy-dev | ||
on: | ||
push: | ||
branches: | ||
- issue_330_deploy_dev | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: arn:aws:iam::035866691871:role/gha-incubator | ||
role-session-name: ghaincubatorsession | ||
aws-region: us-west-2 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
|
||
- name: Build, tag, and push the image to Amazon ECR | ||
id: build-image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: people-depot-backend | ||
IMAGE_TAG: dev | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |
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,63 @@ | ||
# pull official base image | ||
FROM python:3.10-alpine | ||
|
||
# set work directory | ||
WORKDIR /usr/src/app | ||
|
||
# set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# install system dependencies | ||
RUN \ | ||
apk add \ | ||
'graphviz=~12' | ||
|
||
# install font for graphviz | ||
COPY Roboto-Regular.ttf /root/.fonts/ | ||
RUN fc-cache -f | ||
|
||
# install dependencies | ||
COPY ./requirements.txt . | ||
# hadolint ignore=DL3042 | ||
RUN \ | ||
pip install uv==0.1.15 \ | ||
&& uv pip install --system -r requirements.txt | ||
|
||
|
||
# copy project | ||
COPY . . | ||
|
||
# run entrypoint.sh | ||
# Use the official Python runtime image | ||
FROM python:3.13 | ||
|
||
# Create the app directory | ||
RUN mkdir /app | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Set environment variables | ||
# Prevents Python from writing pyc files to disk | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
#Prevents Python from buffering stdout and stderr | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Upgrade pip | ||
RUN pip install --upgrade pip | ||
|
||
# Copy the Django project and install dependencies | ||
COPY requirements.txt /app/ | ||
|
||
# run this command to install all dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the Django project to the container | ||
COPY . /app/ | ||
|
||
# Expose the Django port | ||
EXPOSE 8000 | ||
|
||
# Run Django’s development server | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |