-
Notifications
You must be signed in to change notification settings - Fork 1
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
23 changed files
with
3,950 additions
and
4,558 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 @@ | ||
web/node_modules |
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,50 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
IMAGE: ${{ secrets.IMAGE_URL }} | ||
PAT: ${{ secrets.PAT }} | ||
|
||
jobs: | ||
build-api: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./api | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Registry login | ||
run: echo $PAT | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
|
||
- name: Pull Docker Image | ||
run: docker pull $IMAGE/api:latest | ||
|
||
- name: Tag Docker Image | ||
run: docker build . --tag $IMAGE/api:latest --cache-from $IMAGE:latest | ||
|
||
- name: Push Docker Image | ||
run: docker push $IMAGE/api:latest | ||
build-web: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./web | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Registry login | ||
run: echo $PAT | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
|
||
- name: Pull Docker Image | ||
run: docker pull $IMAGE/web:latest | ||
|
||
- name: Tag Docker Image | ||
run: docker build . --tag $IMAGE/web:latest --cache-from $IMAGE:latest | ||
|
||
- name: Push Docker Image | ||
run: docker push $IMAGE/web:latest |
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
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,4 +1,3 @@ | ||
--requirement requirements.txt | ||
black | ||
debugpy | ||
ipdb |
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,14 +1,20 @@ | ||
from fastapi import FastAPI | ||
from fastapi.middleware.cors import CORSMiddleware | ||
|
||
from src.routes import auth, projects | ||
|
||
app = FastAPI(title="ResDEEDS") | ||
|
||
app.add_middleware( | ||
CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"] | ||
) | ||
|
||
|
||
app.include_router(auth.router, tags=["Auth"], prefix="/api/auth") | ||
app.include_router(projects.router, tags=["Projects"], prefix="/api/projects") | ||
|
||
|
||
@app.get("/") | ||
def read_root(): | ||
def health_check(): | ||
"""Hello World root.""" | ||
return {"Hello": "World"} |
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,18 @@ | ||
#!/bin/bash | ||
|
||
echo "Stopping existing container.." | ||
dzdo docker stop resdeeds-web | ||
|
||
echo "Pulling latest image.." | ||
dzdo docker pull ghcr.io/idaholab/resdeeds/web:latest | ||
|
||
echo "Launching latest container" | ||
dzdo docker run -d --rm \ | ||
-p 80:80 -p 443:443 \ | ||
--name resdeeds-web \ | ||
-v ./etc/ssl:/etc/ssl \ | ||
-v ./etc/nginx:/etc/nginx/conf.d \ | ||
-v /var/log/nginx:/var/log/nginx \ | ||
ghcr.io/idaholab/resdeeds/web:latest | ||
|
||
echo "Deployed" |
Empty file.
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,13 +1,28 @@ | ||
FROM node:20-alpine | ||
FROM node:22 AS build | ||
|
||
WORKDIR /var/www | ||
|
||
COPY . /var/www/ | ||
RUN npm config set strict-ssl false | ||
RUN npm install -g @angular/cli | ||
|
||
RUN npm install | ||
# Configure INL certs and environment variables | ||
ADD http://certstore.inl.gov/pki/CAINLROOT_B64.crt /usr/local/share/ca-certificates/ | ||
RUN /usr/sbin/update-ca-certificates | ||
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \ | ||
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \ | ||
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \ | ||
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \ | ||
SSL_CERT_DIR=/etc/ssl/certs/ | ||
|
||
EXPOSE 4200 | ||
RUN apt-get update | ||
RUN npm i -g @angular/cli \ | ||
&& npm i | ||
|
||
CMD ["ng", "serve", "--host", "0.0.0.0"] | ||
RUN ng build --configuration=production | ||
|
||
FROM nginx:alpine | ||
|
||
COPY --from=build /var/www/dist/resdeeds /usr/share/nginx/html | ||
|
||
EXPOSE 80 443 4200 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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,49 @@ | ||
server { | ||
listen 443 ssl; | ||
server_name localhost; | ||
|
||
# Path to SSL certificate and key | ||
ssl_certificate /etc/ssl/certs/localhost.cer; | ||
ssl_certificate_key /etc/ssl/private/localhost.key; | ||
|
||
# Root directory for the Angular app | ||
root /usr/share/nginx/html; | ||
|
||
# Default file to serve | ||
index index.html; | ||
|
||
# Serve static files from /usr/share/nginx/html | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
# Error pages | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
# Optional: Gzip compression for improved performance | ||
gzip on; | ||
gzip_types text/plain application/javascript text/css application/json application/xml text/javascript; | ||
gzip_min_length 1024; | ||
} | ||
|
||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
# Serve static files from /usr/share/nginx/html | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
# Error pages | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
Oops, something went wrong.