Skip to content

Commit

Permalink
Merge pull request #64 from SocialGouv/feat/mailer-to-nodemailer
Browse files Browse the repository at this point in the history
feat/mailer to nodemailer
  • Loading branch information
ClementNumericite committed Sep 14, 2023
2 parents 512dafc + 0b9cb25 commit 07a63d7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Pour démarrer la suite ELK localement :
docker compose up -d
```

Au premier run ELK, lancez cette suite de commande

```
cd webapp-next
mkdir -p certs/ca
docker cp elasticsearch:/usr/share/elasticsearch/config/certs/ca/ca.crt ./certs/ca/ca.crt
```

Pour initialiser les variables d'environnement NextJS

```
Expand Down
46 changes: 23 additions & 23 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,29 @@ services:
environment:
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}

webapp:
build:
context: webapp-next
args:
- NEXT_PUBLIC_ELASTIC_API_KEY_NAME=${NEXT_PUBLIC_ELASTIC_API_KEY_NAME}
container_name: webapp
depends_on:
- elasticsearch
ports:
- '3000:3000'
volumes:
- certs:/app/certs
networks:
- webapp
environment:
- ELASTIC_HOST=${ELASTIC_HOST}
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
- NODEMAILER_HOST=${NODEMAILER_HOST}
- NODEMAILER_PORT=${NODEMAILER_PORT}
- NODEMAILER_USER=${NODEMAILER_USER}
- NODEMAILER_PASSWORD=${NODEMAILER_PASSWORD}
- NODEMAILER_FROM=${NODEMAILER_FROM}
- NODEMAILER_BASEURL=${NODEMAILER_BASEURL}
# webapp:
# build:
# context: webapp-next
# args:
# - NEXT_PUBLIC_ELASTIC_API_KEY_NAME=${NEXT_PUBLIC_ELASTIC_API_KEY_NAME}
# container_name: webapp
# depends_on:
# - elasticsearch
# ports:
# - '3000:3000'
# volumes:
# - certs:/app/certs
# networks:
# - webapp
# environment:
# - ELASTIC_HOST=${ELASTIC_HOST}
# - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
# - NODEMAILER_HOST=${NODEMAILER_HOST}
# - NODEMAILER_PORT=${NODEMAILER_PORT}
# - NODEMAILER_USER=${NODEMAILER_USER}
# - NODEMAILER_NODEMAILER_PASSWORDPORT=${NODEMAILER_PASSWORD}
# - NODEMAILER_FROM=${NODEMAILER_FROM}
# - NODEMAILER_BASEURL=${NODEMAILER_BASEURL}

volumes:
certs:
Expand Down
18 changes: 9 additions & 9 deletions webapp-next/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ WORKDIR /app

ENV NODE_ENV production

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs

COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules

COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
RUN chmod 1777 /tmp
RUN chmod 1777 /app

USER 1001

USER nextjs
EXPOSE 3000
ENV PORT 3000

CMD ["node", "server.js"]
CMD ["yarn", "start"]
1 change: 1 addition & 0 deletions webapp-next/components/login/FormLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const FormLogin = () => {
startTimer();
setShowCodeForm(true);
} catch (e) {
console.log(e);
setFormError(true);
}

Expand Down

0 comments on commit 07a63d7

Please sign in to comment.