version: '3.7'
#настройка сети
networks:
static-network:
ipam:
driver: default
config:
- subnet: 10.5.0.0/16
services:
database:
image: postgres:13 # имя контейнера
container_name: "postgres_cont"
ports:
- "6532:5432"
env_file:
- pg-env.env # configure env postgres
volumes:
- E:\docker\volumes\postgres:/var/lib/postgresql/data
restart: unless-stopped #рестарт если контейнер "вылетает"
logging: #отключаем логирование в консоли
driver: none
networks:
static-network:
ipv4_address: 10.5.0.5
app_fastapi:
container_name: "app_FastAPI"
build:
context: ./FastAPI
dockerfile: Dockerfile
volumes:
- ./FastAPI:/app_fastapi
ports:
- 8000:8000
depends_on:
- database
entrypoint: ["python", "main.py"]
restart: unless-stopped
networks: #принудительно задаём IP
static-network:
ipv4_address: 10.5.0.6
vue_frontend:
container_name: vue_ui
build:
context: ./pprint_vue
dockerfile: Dockerfile
volumes:
- ./pprint_vue:/vue_crm
- /vue_crm/node_modules
ports:
- "8080:8080"
restart: unless-stopped
depends_on:
- database
- app_fastapi
networks: #принудительно задаём IP
static-network:
ipv4_address: 10.5.0.10
FROM node:15.10.0
ARG APP_DIR=vue_crm
WORKDIR /${APP_DIR}
COPY package*.json ./
RUN npm install --no-optional
EXPOSE 8080
CMD ["npm", "run", "serve"]
environment:
- CHOKIDAR_USEPOLLING=true
.gitignore
.git
.idea
node_modules
FROM node:lts-alpine as build
ARG APP_DIR=app
WORKDIR /${APP_DIR}
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
RUN npm install npm@latest
RUN npm install --no-progress --ignore-optional
RUN npm install @vue/cli -g
EXPOSE 5000
CMD ["npm", "run", "serve"]
version: '3.9'
#настройка сети между контейнерами.
networks:
static-network:
ipam:
driver: default
config:
- subnet: 10.5.0.0/16
services:
database:
image: postgres:13 # имя контейнера
container_name: "postgres_cont"
ports:
- "6532:5432"
env_file:
- pg-env.env # configure env postgres
volumes:
- E:\docker\volumes\postgres:/var/lib/postgresql/data
restart: unless-stopped #рестарт если контейнер "вылетает"
logging: #отключаем логирование в консоли
driver: none
networks:
static-network:
ipv4_address: 10.5.0.5
pgAdmin:
image: dpage/pgadmin4 #имя контейнера
container_name: "pgAdmin_cont"
ports:
- "5555:80"
env_file:
- pgadmin-env.env # configure pgAdmin
depends_on:
- database
volumes:
- E:\docker\volumes\pgAdmin:/var/lib/pgadmin
restart: unless-stopped #рестарт если контейнер "вылетает"
logging: #отключаем логирование в консоли
driver: none
networks:
static-network:
ipv4_address: 10.5.0.8
app_fastapi:
# image: python:3.8
container_name: "app_FastAPI" #имя контейнера
build:
context: ./FastAPI
dockerfile: Dockerfile
volumes:
- ./FastAPI:/app_fastapi
ports:
- 8000:8000
depends_on:
- database
entrypoint: ["python", "main.py"]
restart: unless-stopped #рестарт если контейнер "вылетает"
networks: #принудительно задаём IP
static-network:
ipv4_address: 10.5.0.6
vue_frontend:
container_name: vue_ui
build:
context: ./pprint_vue
dockerfile: Dockerfile
stdin_open: true
tty: true
environment:
- CHOKIDAR_USEPOLLING=true
volumes:
- ./pprint_vue:/app
- /app/node_modules
ports:
- "5000:5000"
restart: unless-stopped #рестарт если контейнер "вылетает"
depends_on:
- app_fastapi
networks: #принудительно задаём IP
static-network:
ipv4_address: 10.5.0.10
volumes:
pprint_vue:
name: pprint_vue
FastAPI:
name: FastAPI
"scripts": {
"serve": "vue-cli-service serve --port 5000",
"build": "vue-cli-service build"
},