mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-13 09:45:50 +00:00
switch to non root dockerfile for ui and api containers
https://github.com/ohmyform/ohmyform/issues/97
This commit is contained in:
parent
3937e584ed
commit
a6c98b6dfd
@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- typo in dropdown options https://github.com/ohmyform/ohmyform/issues/96
|
- typo in dropdown options https://github.com/ohmyform/ohmyform/issues/96
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
- container now runs as non root user
|
||||||
|
|
||||||
## [0.9.5] - 2020-06-10
|
## [0.9.5] - 2020-06-10
|
||||||
|
|
||||||
|
|||||||
16
Dockerfile
16
Dockerfile
@ -1,4 +1,5 @@
|
|||||||
FROM node:12-alpine
|
FROM node:12-alpine AS builder
|
||||||
|
MAINTAINER OhMyForm <admin@ohmyform.com>
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
@ -7,6 +8,19 @@ COPY . ./
|
|||||||
RUN yarn install --frozen-lock-file
|
RUN yarn install --frozen-lock-file
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
|
FROM node:12-alpine
|
||||||
|
MAINTAINER OhMyForm <admin@ohmyform.com>
|
||||||
|
|
||||||
|
# Create a group and a user with name "ohmyform".
|
||||||
|
RUN addgroup --gid 9999 ohmyform && adduser -D --uid 9999 -G ohmyform ohmyform
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
COPY --from=builder /usr/src/app /usr/src/app
|
||||||
|
|
||||||
ENV PORT=4000
|
ENV PORT=4000
|
||||||
|
|
||||||
|
# Change to non-root privilege
|
||||||
|
USER ohmyform
|
||||||
|
|
||||||
CMD [ "yarn", "start" ]
|
CMD [ "yarn", "start" ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user