update docker
This commit is contained in:
parent
7ab1fdca74
commit
efefdeedc7
@ -1,5 +1,8 @@
|
||||
# Backend Dockerfile
|
||||
FROM node:16-alpine
|
||||
FROM node:18-slim
|
||||
|
||||
# Установка зависимостей для сборки нативных модулей
|
||||
RUN apt-get update && apt-get install -y python3 build-essential curl && apt-get clean
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
@ -8,7 +11,7 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci --only=production
|
||||
RUN npm install --only=production
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
@ -4,8 +4,8 @@ FROM nginx:alpine
|
||||
# Copy static files
|
||||
COPY . /usr/share/nginx/html/
|
||||
|
||||
# Copy nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Устанавливаем правильные права
|
||||
RUN chmod -R 755 /usr/share/nginx/html/
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
@ -1,24 +1,21 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Frontend Service
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
context: ../frontend
|
||||
dockerfile: ../docker/Dockerfile.frontend
|
||||
container_name: cash_system_frontend
|
||||
ports:
|
||||
- "3000:80"
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
- cash_system_network
|
||||
|
||||
# Backend Service
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
context: ../backend
|
||||
dockerfile: ../docker/Dockerfile.backend
|
||||
container_name: cash_system_backend
|
||||
ports:
|
||||
- "3001:3001"
|
||||
@ -27,7 +24,7 @@ services:
|
||||
- PORT=3001
|
||||
- DB_PATH=/app/data/database.sqlite
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ../data:/app/data
|
||||
networks:
|
||||
- cash_system_network
|
||||
|
||||
@ -38,7 +35,7 @@ services:
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./docker/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
|
@ -1,5 +1,5 @@
|
||||
//API
|
||||
const API_BASE_URL = "http://localhost:3001/api";
|
||||
const API_BASE_URL = "http://195.209.214.159/api";
|
||||
|
||||
//Login
|
||||
async function loginUser(username, password) {
|
||||
|
Loading…
Reference in New Issue
Block a user