0
0
Fork 0

refs #5739 feat: run docker in local

This commit is contained in:
Alex Moreno 2024-01-04 15:43:58 +01:00
parent 4306226e5c
commit ac371049d5
6 changed files with 68 additions and 21 deletions

View File

@ -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"]
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"]

16
docker-compose.local.yml Normal file
View File

@ -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

10
docker-compose.test.yml Normal file
View File

@ -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

View File

@ -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",

View File

@ -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,