forked from verdnatura/salix-front
refs #5739 feat: run docker in local
This commit is contained in:
parent
4306226e5c
commit
ac371049d5
23
Dockerfile
23
Dockerfile
|
@ -1,5 +1,24 @@
|
|||
FROM node:stretch-slim
|
||||
FROM node:20-bullseye as base
|
||||
|
||||
FROM base AS production
|
||||
RUN npm install -g @quasar/cli
|
||||
WORKDIR /app
|
||||
COPY dist/spa ./
|
||||
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]
|
||||
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]
|
||||
|
||||
FROM base AS test
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
COPY src src
|
||||
COPY test test
|
||||
COPY quasar quasar
|
||||
|
||||
RUN npm i
|
||||
|
||||
CMD ["npx", "quasar", "dev"]
|
||||
|
||||
FROM base AS local
|
||||
WORKDIR /app
|
||||
CMD ["npx", "quasar", "dev"]
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
lilium:
|
||||
image: lilium-front
|
||||
restart: always
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: local
|
||||
ports:
|
||||
- 9000:9000
|
||||
volumes:
|
||||
- .:/app
|
||||
networks:
|
||||
salix-stack-network:
|
||||
driver: host
|
|
@ -0,0 +1,10 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
lilium:
|
||||
image: lilium-front
|
||||
restart: always
|
||||
command: ['npm', 'run', 'test:unit:ci']
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: test
|
|
@ -1,17 +1,17 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
main:
|
||||
image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
ports:
|
||||
- 4000
|
||||
deploy:
|
||||
replicas: ${FRONT_REPLICAS:?}
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 1G
|
||||
main:
|
||||
image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
ports:
|
||||
- 4000
|
||||
deploy:
|
||||
replicas: ${FRONT_REPLICAS:?}
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 1G
|
||||
|
|
|
@ -7,12 +7,14 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .js,.vue ./",
|
||||
"start": "docker compose -p salix -f docker-compose.local.yml up",
|
||||
"restart": "docker compose -p salix -f docker-compose.local.yml up --build",
|
||||
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
||||
"test:e2e": "cypress open",
|
||||
"test:e2e:ci": "cd ../salix && gulp docker && cd ../salix-front && cypress run",
|
||||
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
|
||||
"test:unit": "vitest",
|
||||
"test:unit:ci": "vitest run"
|
||||
"test:unit:ci": "docker-compose -f docker-compose.test.yml run --rm lilium"
|
||||
},
|
||||
"dependencies": {
|
||||
"@quasar/cli": "^2.3.0",
|
||||
|
|
|
@ -67,7 +67,7 @@ module.exports = configure(function (/* ctx */) {
|
|||
// analyze: true,
|
||||
// env: {},
|
||||
rawDefine: {
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
},
|
||||
// ignorePublicFolder: true,
|
||||
// minify: false,
|
||||
|
@ -92,7 +92,7 @@ module.exports = configure(function (/* ctx */) {
|
|||
vitePlugins: [
|
||||
[
|
||||
VueI18nPlugin({
|
||||
runtimeOnly: false
|
||||
runtimeOnly: false,
|
||||
}),
|
||||
{
|
||||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
||||
|
@ -111,7 +111,7 @@ module.exports = configure(function (/* ctx */) {
|
|||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://0.0.0.0:3000',
|
||||
target: 'http://back:3000',
|
||||
logLevel: 'debug',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
|
|
Loading…
Reference in New Issue