Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Page #79

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3db3755
Merge pull request #2 from kristo-baricevic/feedback-form2
kristo-baricevic Oct 11, 2023
947c504
feat(ci): add automated release workflow
themightychris Nov 15, 2023
477c1f7
Add helm chart (in project root) and files for static demo server
joshuagerstein Dec 12, 2023
aef6135
Merge pull request #56 from CodeForPhilly/develop
themightychris Dec 13, 2023
5620c9c
fix(ci): show same Docker tag in log output
themightychris Dec 13, 2023
82b8b37
fix(ci): trigger container builds on tags
themightychris Dec 13, 2023
c657730
Merge pull request #65 from CodeForPhilly/helm-chart-2
themightychris Dec 13, 2023
140bc92
Merge pull request #66 from CodeForPhilly/develop
themightychris Dec 13, 2023
a84cfef
fix(ci): add explicit write permission for packages
themightychris Dec 13, 2023
caced0a
Merge pull request #67 from CodeForPhilly/develop
themightychris Dec 13, 2023
a60d5bd
Merge branch 'main' of https://github.com/CodeForPhilly/balancer-main
kristo-baricevic Feb 4, 2024
e023c7f
test
kristo-baricevic Feb 4, 2024
8e8921d
Merge branch
kristo-baricevic Feb 4, 2024
d26eac4
Merge branch 'listOfMed'
kristo-baricevic Feb 11, 2024
aecffba
Merge branch 'listOfMed'
kristo-baricevic Feb 12, 2024
7382cb0
Merge pull request #4 from kristo-baricevic/listOfMed
kristo-baricevic Feb 13, 2024
7761fc2
Delete config/env/env.dev
kristo-baricevic Feb 13, 2024
0a4a098
font sizes
kristo-baricevic Feb 22, 2024
b727f6a
updated fonts and size of card
kristo-baricevic Feb 22, 2024
fb4e501
Merge branch 'main' into listOfMed
kristo-baricevic Feb 22, 2024
f5705b4
Merge pull request #5 from kristo-baricevic/listOfMed
kristo-baricevic Feb 22, 2024
77a4b3b
merge
kristo-baricevic Feb 23, 2024
72cbf83
Merge pull request #6 from kristo-baricevic/listOfMed
kristo-baricevic Feb 23, 2024
1fffb89
adjusted width
kristo-baricevic Feb 24, 2024
94c2f0c
updated colors
kristo-baricevic Mar 12, 2024
67d692a
Merge branch 'listOfMed' of https://github.com/CodeForPhilly/balancer…
kristo-baricevic Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/containers-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<<<<<<< HEAD
name: 'Containers: Publish'

on:
push:
tags: [ 'v*' ]
=======
name: "Containers: Publish"

on:
push:
tags: ["v*"]
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933

permissions:
packages: write
Expand All @@ -12,6 +20,48 @@ jobs:
name: Build and Push
runs-on: ubuntu-latest
steps:
<<<<<<< HEAD

- uses: actions/checkout@v3

- name: Login to ghcr.io Docker registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute Docker container image addresses
run: |
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
DOCKER_TAG="${GITHUB_REF:11}"

echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV

echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}"

# - name: 'Pull previous Docker container image: :latest'
# run: docker pull "${DOCKER_REPOSITORY}:latest" || true

- name: 'Pull previous Docker container image: frontend-static:latest'
run: docker pull "${DOCKER_REPOSITORY}/frontend-static:latest" || true

- name: 'Build Docker container image: frontend-static:latest'
run: |
docker build \
--cache-from "${DOCKER_REPOSITORY}/frontend-static:latest" \
--file frontend/Dockerfile.demo \
--build-arg SERVER_NAME=localhost \
--tag "${DOCKER_REPOSITORY}/frontend-static:latest" \
--tag "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}" \
frontend
- name: 'Push Docker container image frontend-static:latest'
run: docker push "${DOCKER_REPOSITORY}/frontend-static:latest"

- name: 'Push Docker container image frontend-static:v*'
run: docker push "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}"
=======
- uses: actions/checkout@v3

- name: Login to ghcr.io Docker registry
Expand Down Expand Up @@ -51,6 +101,7 @@ jobs:

- name: "Push Docker container image frontend-static:v*"
run: docker push "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}"
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933
#
#
# - name: 'Build Docker container image: backend:latest'
Expand All @@ -65,5 +116,10 @@ jobs:
# - name: Push Docker container image backend:v*
# run: docker push "${DOCKER_REPOSITORY}/backend:${DOCKER_TAG}"

<<<<<<< HEAD
# - name: Push Docker container image :v*"
# run: docker push "${DOCKER_REPOSITORY}:${DOCKER_TAG}"
=======
# - name: Push Docker container image :v*"
# run: docker push "${DOCKER_REPOSITORY}:${DOCKER_TAG}"
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933
19 changes: 19 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
<<<<<<< HEAD
name: 'Release: Prepare PR'

on:
push:
branches: [ develop ]
=======
name: "Release: Prepare PR"

on:
push:
branches: [develop]
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933

permissions:
contents: read
pull-requests: write

jobs:
release-prepare:
<<<<<<< HEAD

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: main
=======
runs-on: ubuntu-latest
steps:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: main
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933
19 changes: 19 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<<<<<<< HEAD
name: 'Release: Publish PR'

on:
pull_request:
branches: [ main ]
types: [ closed ]

jobs:
release-publish:

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
=======
name: "Release: Publish PR"

on:
Expand All @@ -12,3 +30,4 @@ jobs:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933
19 changes: 19 additions & 0 deletions .github/workflows/release-validate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<<<<<<< HEAD
name: 'Release: Validate PR'

on:
pull_request:
branches: [ main ]
types: [ opened, edited, reopened, synchronize ]

jobs:
release-validate:

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
=======
name: "Release: Validate PR"

on:
Expand All @@ -12,3 +30,4 @@ jobs:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
>>>>>>> afb000d3a3ee90a677a2580d82fe3a432d1c1933
71 changes: 71 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
###########
# BUILDER #
###########

# pull official base image
FROM python:3.11.4-slim-buster as builder

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc

# lint
# RUN pip install --upgrade pip
# RUN pip install flake8==6.0.0
# COPY . /usr/src/app/
# RUN flake8 --ignore=E501,F401 .

# install python dependencies
COPY ./requirements.txt .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt


#########
# FINAL #
#########

# pull official base image
FROM python:3.11.4-slim-buster

# create directory for the app user
RUN mkdir -p /home/app

# create the app user
RUN addgroup --system app && adduser --system --group app

# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

# install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends netcat
COPY --from=builder /usr/src/app/wheels /wheels
COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache /wheels/*

# copy entrypoint.prod.sh
COPY ./entrypoint.prod.sh .
RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.prod.sh
RUN chmod +x $APP_HOME/entrypoint.prod.sh

# copy project
COPY . $APP_HOME

# chown all the files to the app user
RUN chown -R app:app $APP_HOME

# change to the app user
USER app

# run entrypoint.prod.sh
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
43 changes: 8 additions & 35 deletions docker-compose.yml → docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,29 @@ services:
- POSTGRES_DB=balancer_dev
ports:
- "5432:5432"
networks:
app_net:
ipv4_address: 192.168.0.2
pgadmin:
container_name: pgadmin4
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: balancer
# PGADMIN_LISTEN_PORT = 80
# volumes:
# - ./pgadmin-data:/var/lib/pgadmin
# # PGADMIN_LISTEN_PORT = 80
ports:
- "5050:80"
networks:
app_net:
ipv4_address: 192.168.0.3
backend:
image: balancer-backend
build: ./server
<<<<<<< HEAD:docker-compose.dev.yml
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./server:/usr/src/app
=======
>>>>>>> ed1b2e3bc80a77cb1283844d0c153fa1f79d9d76:docker-compose.yml
ports:
- "8000:8000"
env_file:
- ./config/env/env.dev
depends_on:
- db
volumes:
- ./server:/usr/src/server
networks:
app_net:
ipv4_address: 192.168.0.4
frontend:
image: balancer-frontend
build:
context: frontend
dockerfile: Dockerfile
dockerfile: Dockerfile.dev
args:
- IMAGE_NAME=balancer-frontend
- FRONTEND_VERSION=0.0.1
ports:
- "3000:3000"
environment:
Expand All @@ -60,16 +43,6 @@ services:
- "/usr/src/app/node_modules/"
depends_on:
- backend
networks:
app_net:
ipv4_address: 192.168.0.5

volumes:
postgres_data:
networks:
app_net:
ipam:
driver: default
config:
- subnet: "192.168.0.0/24"
gateway: 192.168.0.1
postgres_data:
3 changes: 3 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ services:
- ./config/env/env.dev
depends_on:
- db
<<<<<<< HEAD
=======
frontend:
image: balancer-frontend
build:
Expand All @@ -38,6 +40,7 @@ services:
- "/usr/src/app/node_modules/"
depends_on:
- backend
>>>>>>> ac68347c12ced724206112843623ee8c515bd3ad

volumes:
postgres_data:
2 changes: 0 additions & 2 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ config/env/env.dev
*.njsproj
*.sln
*.sw?

.DS_Store
38 changes: 38 additions & 0 deletions frontend/Dockerfile.demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This dockerfile builds an image for a static frontend only server suitable for online hosting.
# Use the official Node.js image as the base image
FROM node:18 as builder

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Set version number
ARG FRONTEND_VERSION
RUN npm version $FRONTEND_VERSION

# Install dependencies
RUN npm ci --legacy-peer-deps

# Copy project files
COPY . .

RUN npm run build

FROM alpine:latest as nginx-config
RUN apk --no-cache add gettext
WORKDIR /app
COPY nginx.conf.demo ./nginx.conf.demo
# This will get overwritten by helm chart

ARG SERVER_NAME
ENV SERVER_NAME $SERVER_NAME
RUN cat nginx.conf.demo | envsubst > nginx.conf

FROM nginx:alpine

COPY --from=nginx-config /app/nginx.conf /etc/nginx/nginx.conf
COPY --from=Builder /usr/src/app/dist /usr/share/nginx/html

# The default entrypoint works for us.
Loading