This commit is contained in:
51
.drone.yml
Normal file
51
.drone.yml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: testing
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker:dind
|
||||||
|
environment:
|
||||||
|
COMPOSE_PROJECT_NAME: adv-testing-${DRONE_COMMIT_BRANCH//\//-}
|
||||||
|
NUXT_APP_BASE_URL: /${DRONE_COMMIT_BRANCH}/
|
||||||
|
SERVICE_3000_CHECK_HTTP: /${DRONE_COMMIT_BRANCH}/
|
||||||
|
SERVICE_3000_TAGS: urlprefix-testing.async.io/adv/${DRONE_COMMIT_BRANCH}/*
|
||||||
|
commands:
|
||||||
|
- docker compose -f docker/docker-compose.yml -f docker/docker-compose.labels.yml up --build -d
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: appleboy/drone-telegram
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
|
settings:
|
||||||
|
token:
|
||||||
|
from_secret: telegram_token
|
||||||
|
to:
|
||||||
|
from_secret: telegram_chat_id_atr
|
||||||
|
format: markdown
|
||||||
|
message: >
|
||||||
|
{{#success build.status}}
|
||||||
|
✅ `{{commit.email}}` a mis à jour la branche `{{commit.branch}}` sur le repo `{{repo.name}}`:
|
||||||
|
```
|
||||||
|
{{commit.message}}
|
||||||
|
```
|
||||||
|
🌐 https://testing.async.io/adv/{{commit.branch}}/
|
||||||
|
{{else}}
|
||||||
|
❌ Le build #{{build.number}} du repo `{{repo.name}}` est un gros fail...
|
||||||
|
📝 Commit de {{commit.email}} sur la branche `{{commit.branch}}`:
|
||||||
|
```
|
||||||
|
{{commit.message}}
|
||||||
|
```
|
||||||
|
🌐 {{ build.link }}
|
||||||
|
{{/success}}
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
17
docker/Dockerfile
Normal file
17
docker/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
ARG NODE_VERSION=22
|
||||||
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
FROM base AS build
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY --link ./ ./
|
||||||
|
|
||||||
|
FROM build AS master
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM base AS prod
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
# COPY --from=build /app/node_modules /app/node_modules
|
||||||
|
COPY --from=master /app/.output /app/.output
|
||||||
|
CMD [ "node", ".output/server/index.mjs" ]
|
||||||
8
docker/docker-compose.labels.yml
Normal file
8
docker/docker-compose.labels.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
front:
|
||||||
|
labels:
|
||||||
|
- SERVICE_3000_CHECK_HTTP=${SERVICE_3000_CHECK_HTTP:-/}
|
||||||
|
- SERVICE_3000_NAME=${SERVICE_3000_NAME:-${COMPOSE_PROJECT_NAME:-adv}-front-3000}
|
||||||
|
- SERVICE_3000_TAGS=${SERVICE_3000_TAGS:-urlprefix-adv.localhost/}
|
||||||
7
docker/docker-compose.local.yml
Normal file
7
docker/docker-compose.local.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
front:
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
|
||||||
12
docker/docker-compose.yml
Normal file
12
docker/docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
front:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
|
environment:
|
||||||
|
NODE_ENV: ${NODE_ENV:-production}
|
||||||
|
NUXT_APP_BASE_URL: ${NUXT_APP_BASE_URL:-/}
|
||||||
|
ports:
|
||||||
|
- 3000
|
||||||
Reference in New Issue
Block a user