Compare commits

..

8 Commits

Author SHA1 Message Date
389bc63592 fix: update Nginx configuration and Dockerfile paths for Vue application
All checks were successful
Deploy Application / deploy (push) Successful in 21s
Test runner / check-runner (push) Successful in 3s
2026-01-06 22:32:49 +01:00
5d5cc18678 fix: correct typo in path for .env file creation in deployment workflow
All checks were successful
Deploy Application / deploy (push) Successful in 12s
Test runner / check-runner (push) Successful in 3s
2026-01-06 22:20:34 +01:00
93798904d1 fix: add step to create .env file from Gitea secret in deployment workflow
Some checks failed
Deploy Application / deploy (push) Failing after 6s
Test runner / check-runner (push) Successful in 3s
2026-01-06 22:13:03 +01:00
2749791eed fix: update container names in docker-compose for backend and frontend services
All checks were successful
Deploy Application / deploy (push) Successful in 10s
Test runner / check-runner (push) Successful in 3s
2026-01-06 22:04:40 +01:00
57dd7d169f fix: correct paths in Dockerfiles for requirements and package files
Some checks failed
Deploy Application / deploy (push) Failing after 53s
Test runner / check-runner (push) Successful in 3s
2026-01-06 21:55:02 +01:00
9890563dc2 fix: update Dockerfile to correct paths for package.json and source files
Some checks failed
Deploy Application / deploy (push) Failing after 11s
Test runner / check-runner (push) Successful in 3s
2026-01-06 21:51:10 +01:00
f4895eaa03 fix: update docker-compose paths for backend and frontend services
Some checks failed
Deploy Application / deploy (push) Failing after 9s
Test runner / check-runner (push) Successful in 3s
2026-01-06 21:48:26 +01:00
ab5f7c3854 fix: update Docker commands in deployment workflow to use 'docker compose' syntax
Some checks failed
Deploy Application / deploy (push) Failing after 11s
Test runner / check-runner (push) Successful in 3s
2026-01-06 21:34:58 +01:00
5 changed files with 37 additions and 35 deletions

View File

@@ -12,8 +12,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Create .env file from Gitea secret
run: echo "${{ secrets.BACKEND_ENV }}" > backend/.env
- name: Build and restart Docker containers - name: Build and restart Docker containers
run: | run: |
docker-compose down docker compose down
docker-compose build docker compose build
docker-compose up -d docker compose up -d

View File

@@ -2,9 +2,9 @@ FROM python:3.12-slim
WORKDIR /app WORKDIR /app
COPY backend/requirements.txt /app/ COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
COPY backend /app COPY . /app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

View File

@@ -3,16 +3,16 @@ version: "3.9"
services: services:
backend: backend:
build: build:
context: . context: ./backend
dockerfile: backend/Dockerfile dockerfile: Dockerfile
container_name: my-backend container_name: odoo-hours-backend
restart: unless-stopped restart: unless-stopped
frontend: frontend:
build: build:
context: . context: ./frontend
dockerfile: frontend/Dockerfile dockerfile: Dockerfile
container_name: my-frontend container_name: odoo-hours-frontend
ports: ports:
- "6080:80" - "6080:80"
restart: unless-stopped restart: unless-stopped

View File

@@ -1,14 +1,14 @@
# Etap 1: Build Vue # Etap 1: Build Vue
FROM node:20 AS build FROM node:20 AS build
WORKDIR /app WORKDIR /app
COPY frontend/package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY frontend ./ COPY . ./
RUN npm run build RUN npm run build
# Etap 2: Nginx serwujący Vue + proxy do backendu # Etap 2: Nginx serwujący Vue + proxy do backendu
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html/odoo
# Konfiguracja Nginx z proxy # Konfiguracja Nginx z proxy
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf

View File

@@ -1,32 +1,13 @@
server { server {
listen 80; listen 80;
root /usr/share/nginx/html;
index index.html;
# Przekierowanie bez / na /odoo/ # Przekierowanie bez / na /odoo/
location = /odoo { location = /odoo {
return 301 /odoo/; return 301 /odoo/;
} }
# Serwowanie Vue
location /odoo/ {
alias /usr/share/nginx/html/;
index index.html;
try_files $uri $uri/ /odoo/index.html;
}
# no cache index.html
location = /odoo/index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
expires 0;
}
# cache JS/CSS/OBRAZY na długo
location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
expires 1y;
alias /usr/share/nginx/html/;
}
# Proxy do backendu # Proxy do backendu
location /odoo/api/ { location /odoo/api/ {
proxy_pass http://backend:8000/; proxy_pass http://backend:8000/;
@@ -35,5 +16,23 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
# Serwowanie Vue
location /odoo/ {
try_files $uri $uri/ /odoo/index.html;
}
# Ustawienia cache dla assetów
location ~* /odoo/.*\.(?:js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
expires 1y;
}
# Brak cache'owania dla pliku index.html
location = /odoo/index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
expires 0;
}
} }