Skip to content

Commit

Permalink
going back to basics
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBassoOcto committed Feb 13, 2024
1 parent 7a64252 commit ce8f88f
Show file tree
Hide file tree
Showing 52 changed files with 4 additions and 16,632 deletions.
344 changes: 0 additions & 344 deletions CHANGELOG.md

This file was deleted.

47 changes: 4 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,7 @@
ARG NODE_VERSION=16-alpine3.16
FROM ghcr.io/socialgouv/docker/nginx:7.0.1

# Install dependencies only when needed
FROM node:$NODE_VERSION AS prepare
RUN apk add --no-cache libc6-compat=1.2.3-r2
WORKDIR /app
COPY package.json yarn.lock ./

# Keep yarn install cache when bumping version and dependencies still the sames
RUN node -e " \
const package = JSON.parse(fs.readFileSync('/app/package.json')); \
const packageZero = { ...package, version: '0.0.0' }; \
fs.writeFileSync('/app/package.json', JSON.stringify(packageZero));"
ARG COMMIT_SHA
ENV COMMIT_SHA $COMMIT_SHA

FROM node:$NODE_VERSION as deps
WORKDIR /app
COPY --from=prepare /app/package.json /app/yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:$NODE_VERSION AS builder

ARG PRODUCTION
ENV PRODUCTION $PRODUCTION
ARG GITHUB_SHA
ENV GITHUB_SHA $GITHUB_SHA
ARG NEXT_PUBLIC_SITE_URL
ENV NEXT_PUBLIC_SITE_URL $NEXT_PUBLIC_SITE_URL

ENV NODE_ENV production
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN if [ -z "$PRODUCTION" ]; then \
echo "Overriding .env for staging"; \
cp .env.staging .env.production; \
fi && \
yarn build:export

# Production image, copy all the files and run next
FROM ghcr.io/socialgouv/docker/nginx:7.3.0 AS runner

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

# Disable nextjs telemetry
ENV NEXT_TELEMETRY_DISABLED 1
RUN echo "hello, world #$COMMIT_SHA" > /usr/share/nginx/html/index.html
121 changes: 0 additions & 121 deletions README.md

This file was deleted.

12 changes: 0 additions & 12 deletions csp.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions cypress/integration/accessibilite.spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cypress/integration/cgu.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions cypress/integration/healthz.spec.ts

This file was deleted.

13 changes: 0 additions & 13 deletions cypress/integration/home.spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions cypress/integration/mentions-legales.spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions cypress/integration/politique-confidentialite.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions cypress/integration/stats.spec.ts

This file was deleted.

22 changes: 0 additions & 22 deletions cypress/plugins/index.ts

This file was deleted.

25 changes: 0 additions & 25 deletions cypress/support/commands.ts

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/support/index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions cypress/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion jest-setup.ts

This file was deleted.

33 changes: 0 additions & 33 deletions jest.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions lint-staged.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions next-env.d.ts

This file was deleted.

Loading

0 comments on commit ce8f88f

Please sign in to comment.