[Added] Docker compose, Gitea workflows, production to Dockerfile, Nginx conf
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
name: Portfolio App Deployment
|
||||
run-name: ${{ gitea.actor }} is deploying Portfolio App
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
Portfolio Runner:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- run: docker compose up -d --build
|
||||
@@ -0,0 +1,13 @@
|
||||
name: Portfolio App Testing
|
||||
run-name: ${{ gitea.actor }} is testing Portfolio App
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Portfolio Runner:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: docker --version
|
||||
- run: docker compose version
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
# Run tests
|
||||
+11
-12
@@ -13,20 +13,19 @@ RUN apt-get update && \
|
||||
# If root adds files, it takes ownership, making them unremovable on the host except by using sudo
|
||||
# node tranfers ownership to the host user
|
||||
USER node
|
||||
# EXPOSE 4200
|
||||
CMD ["tail","-f","/dev/null"]
|
||||
|
||||
#--- Building
|
||||
# FROM base AS build
|
||||
# COPY package*.json ./
|
||||
# RUN npm install
|
||||
# # Copied here, since the the Development setup uses a bind volume instead
|
||||
# COPY . .
|
||||
# RUN ng build --configuration production
|
||||
FROM base AS build
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
# Copied here, since the the Development setup uses a bind volume instead
|
||||
COPY . .
|
||||
RUN ng build --configuration production
|
||||
|
||||
#--- Production
|
||||
# FROM nginx:alpine AS production
|
||||
# COPY --from=build /app/dist/quiz/browser /usr/share/nginx/html
|
||||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# EXPOSE 80
|
||||
# CMD ["nginx", "-g", "daemon off;"]
|
||||
FROM nginx:alpine AS production
|
||||
COPY --from=build /app/dist/portfolio/browser /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
image: website-frontend-prod
|
||||
container_name: website-frontend-prod-cont
|
||||
ports:
|
||||
- "4400:80"
|
||||
restart: always
|
||||
cpu_period: 100000 # Default is 100,000 microseconds (100ms)
|
||||
cpu_quota: 5000 # 5% of the total CPU time
|
||||
@@ -0,0 +1,9 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user