feat: Add run production mode with docker-compose.
This commit is contained in:
parent
0ae5079b2a
commit
ba236e5560
|
@ -0,0 +1,24 @@
|
||||||
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
||||||
|
dist/
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
**/*.log
|
||||||
|
|
||||||
|
tests/**/coverage/
|
||||||
|
tests/e2e/reports
|
||||||
|
selenium-debug.log
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.local
|
||||||
|
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM node:10
|
||||||
|
|
||||||
|
# Create app directory
|
||||||
|
WORKDIR /usr/app
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# Install app dependencies
|
||||||
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||||
|
# where available (npm@5+)
|
||||||
|
RUN npm install \
|
||||||
|
&& npm run build:prod
|
||||||
|
# Build state files
|
||||||
|
|
||||||
|
# Start builded application
|
||||||
|
CMD npm run preview
|
|
@ -0,0 +1,20 @@
|
||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web-client:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
container_name: vue-element-admin
|
||||||
|
network_mode: bridge
|
||||||
|
build: .
|
||||||
|
volumes:
|
||||||
|
- /usr/app/
|
||||||
|
- /usr/app/node_modules
|
||||||
|
labels:
|
||||||
|
- app=vue-element-admin
|
||||||
|
stdin_open: true
|
||||||
|
tty: true
|
||||||
|
ports:
|
||||||
|
- 9526:9526 # Prod
|
||||||
|
# - 9527:9527 # Dev
|
Loading…
Reference in New Issue