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
|
RUN npm install -g @quasar/cli
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY dist/spa ./
|
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'
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?}
|
image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile
|
dockerfile: ./Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- 4000
|
- 4000
|
||||||
deploy:
|
deploy:
|
||||||
replicas: ${FRONT_REPLICAS:?}
|
replicas: ${FRONT_REPLICAS:?}
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.role == worker
|
- node.role == worker
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 1G
|
memory: 1G
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint --ext .js,.vue ./",
|
"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",
|
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
||||||
"test:e2e": "cypress open",
|
"test:e2e": "cypress open",
|
||||||
"test:e2e:ci": "cd ../salix && gulp docker && cd ../salix-front && cypress run",
|
"test:e2e:ci": "cd ../salix && gulp docker && cd ../salix-front && cypress run",
|
||||||
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
|
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
|
||||||
"test:unit": "vitest",
|
"test:unit": "vitest",
|
||||||
"test:unit:ci": "vitest run"
|
"test:unit:ci": "docker-compose -f docker-compose.test.yml run --rm lilium"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@quasar/cli": "^2.3.0",
|
"@quasar/cli": "^2.3.0",
|
||||||
|
|
|
@ -67,7 +67,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
// analyze: true,
|
// analyze: true,
|
||||||
// env: {},
|
// env: {},
|
||||||
rawDefine: {
|
rawDefine: {
|
||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||||
},
|
},
|
||||||
// ignorePublicFolder: true,
|
// ignorePublicFolder: true,
|
||||||
// minify: false,
|
// minify: false,
|
||||||
|
@ -92,7 +92,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
vitePlugins: [
|
vitePlugins: [
|
||||||
[
|
[
|
||||||
VueI18nPlugin({
|
VueI18nPlugin({
|
||||||
runtimeOnly: false
|
runtimeOnly: false,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: 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: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://0.0.0.0:3000',
|
target: 'http://back:3000',
|
||||||
logLevel: 'debug',
|
logLevel: 'debug',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
|
|
Loading…
Reference in New Issue