docker production

This commit is contained in:
庄建国 2023-09-19 10:59:43 +00:00
parent ba0861bd43
commit 9f4878aba4
5 changed files with 94 additions and 6 deletions

45
.yarnclean Normal file
View File

@ -0,0 +1,45 @@
# test directories
__tests__
test
tests
powered-test
# asset directories
docs
doc
website
images
assets
# examples
example
examples
# code coverage directories
coverage
.nyc_output
# build scripts
Makefile
Gulpfile.js
Gruntfile.js
# configs
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml
# misc
*.md

View File

@ -5,7 +5,7 @@ services:
steedos:
build:
context: ./
dockerfile: ./docker/Dockerfile.dev
dockerfile: ./docker/Dockerfile
image: steedos/steedos-community:dev
ports:
- "6000:6000"

44
docker/Dockerfile Normal file
View File

@ -0,0 +1,44 @@
FROM node:14-slim AS builder
RUN apt-get update || : && apt-get install -y \
python \
curl \
build-essential
WORKDIR /app
COPY ./.env ./
COPY ./lerna.json ./
COPY ./package.json ./
COPY ./steedos.config.js ./
COPY ./yarn.lock ./
COPY ./.yarnclean ./.yarnclean
COPY ./packages ./packages
COPY ./server ./packages/server
COPY ./services ./services
COPY ./steedos-packages ./services
COPY ./ee ./services
RUN yarn
RUN yarn run build
RUN yarn autoclean
RUN yarn lerna clean --yes
FROM node:14-slim
ENV NODE_ENV=production
ENV NODE_OPTIONS="--max-old-space-size=4096"
WORKDIR /app
COPY --from=builder ./app/.env ./
COPY --from=builder ./app/lerna.json ./
COPY --from=builder ./app/package.json ./
COPY --from=builder ./app/steedos.config.js ./
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/services ./services
RUN yarn --production
RUN yarn cache clean
CMD ["yarn", "start"]

View File

@ -20,18 +20,17 @@
},
"resolutions": {
"@salesforce/ts-types": "1.1.2",
"**/fibers": "5.0.3"
"**/fibers": "5.0.3",
"**/type-fest": "0.21.3"
},
"devDependencies": {
"cnpm": "9.0.1",
"tslib": "^2.4.0",
"@babel/core": "^7.8.4",
"@types/express-serve-static-core": "~4.17.29",
"@types/node": "18.0.3",
"lerna": "^4.0.0",
"nodemon": "^2.0.19",
"typescript": "4.6.3"
},
"dependencies": {
"cnpm": "9.0.1",
"tslib": "^2.4.0"
}
}

BIN
yarn.lock

Binary file not shown.