Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(secu): PSP: use unprivilegied docker user #139

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .k8s/components/front.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import api from "./api";
const getManifests = async () => {
const manifests = await create("recherche-entreprises-front", {
config: {
containerPort: 80,
containerPort: 3000,
},
deployment: {
image: getGithubRegistryImagePath({
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ COPY --from=builder /app/node_modules ./node_modules

WORKDIR /app/dist

USER node
USER 1000

ENTRYPOINT ["node", "./src/index.js"]
7 changes: 6 additions & 1 deletion front/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ ENV REACT_APP_API_URL="%%REACT_APP_API_URL%%"

RUN yarn build

FROM ghcr.io/socialgouv/docker/nginx4spa:6.64.2
FROM ghcr.io/socialgouv/docker/nginx4spa:6.65.0

## switch to non-root user
USER 101

ENV PORT=3000

COPY --from=builder /app/build /usr/share/nginx/html