Compare commits
3 Commits
feat/creat
...
feat--run-
Author | SHA1 | Date | |
---|---|---|---|
be9e7e302b | |||
36319ea002 | |||
f7dd45450b |
53
.github/workflows/build_docker.yml
vendored
53
.github/workflows/build_docker.yml
vendored
@ -1,53 +0,0 @@
|
|||||||
name: Build Docker Image # nom du workflow
|
|
||||||
|
|
||||||
on: #declancheur
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run: #jobs ID (nom du jobs)
|
|
||||||
runs-on: ubuntu-latest # environement de run
|
|
||||||
|
|
||||||
steps: # liste des étapes
|
|
||||||
- name: Checkout # rapatrie le depot
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
git.lab-ouest.org/Epitech/ratrapage_T-WEB_front
|
|
||||||
tags: |
|
|
||||||
type=edge
|
|
||||||
type=ref,event=pr
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
type=semver,pattern=latest
|
|
||||||
|
|
||||||
- name: Login to Gitea
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.lab-ouest.org
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
|
||||||
|
|
||||||
# - name: Set up Docker Buildx
|
|
||||||
# uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build and push front
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./front
|
|
||||||
push: true
|
|
||||||
file: ./front/Dockerfile
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -1,3 +1,6 @@
|
|||||||
|
vars {
|
||||||
|
URL: http://localhost:8080
|
||||||
|
}
|
||||||
vars:secret [
|
vars:secret [
|
||||||
app_key
|
app_key
|
||||||
]
|
]
|
||||||
|
3
bruno/OpenData datatourisme/environments/prod.bru
Normal file
3
bruno/OpenData datatourisme/environments/prod.bru
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
vars:secret [
|
||||||
|
URL
|
||||||
|
]
|
@ -5,11 +5,11 @@ meta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
url: http://localhost:8080
|
url: {{URL}}
|
||||||
body: graphql
|
body: graphql
|
||||||
auth: none
|
auth: none
|
||||||
}
|
}
|
||||||
|
|
||||||
body:graphql {
|
body:graphql {
|
||||||
{poi() {results{dc_identifier rdfs_label}}}
|
{poi() {results{dc_identifier, lastUpdate}}}
|
||||||
}
|
}
|
||||||
|
Submodule datatourisme updated: 5175e1fdf1...af7db7d7a5
@ -1,34 +1,20 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
pocketbase:
|
|
||||||
image: ghcr.io/coollabsio/pocketbase:latest
|
blazegraph:
|
||||||
environment:
|
image: conjecto/blazegraph:2.1.5
|
||||||
- SERVICE_FQDN_POCKETBASE_8080
|
# ports:
|
||||||
volumes:
|
# - 9999:9999
|
||||||
- ./.pb/pocketbase-data:/app/pb_data
|
environment:
|
||||||
- ./.pb/pocketbase-hooks:/app/pb_hooks
|
JAVA_OPTS: "-Xms6G -Xmx6G"
|
||||||
labels:
|
volumes:
|
||||||
- traefik.enable=true
|
- ./datatourisme/dataset:/docker-entrypoint-initdb.d
|
||||||
- traefik.http.routers.poketBaseTweb.rule=Host(`${POCKET_BASE_URL}`)
|
ulimits:
|
||||||
- traefik.http.services.poketBaseTweb.loadbalancer.server.port=${POCKET_BASE_PORT}
|
nofile:
|
||||||
- traefik.http.routers.poketBaseTweb.tls.certresolver=le
|
soft: 65536
|
||||||
networks:
|
hard: 65536
|
||||||
- public
|
datatourisme:
|
||||||
front:
|
image: git.lab-ouest.org/epitech/fork-open-data-tourism:master
|
||||||
image: git.lab-ouest.org/epitech/ratrapage_t-web_front:pr-7-head
|
# ports:
|
||||||
depends_on:
|
# - "8080:80"
|
||||||
- pocketbase
|
depends_on:
|
||||||
labels:
|
- blazegraph
|
||||||
- traefik.enable=true
|
|
||||||
- traefik.http.routers.astroTweb.rule=Host(`${FRONT_URL}`)
|
|
||||||
- traefik.http.services.astroTweb.loadbalancer.server.port=${FRONT_BASE_PORT}
|
|
||||||
- traefik.http.routers.astroTweb.tls.certresolver=le
|
|
||||||
networks:
|
|
||||||
- public
|
|
||||||
networks:
|
|
||||||
public:
|
|
||||||
external: true
|
|
||||||
x-dockge:
|
|
||||||
urls:
|
|
||||||
- https://${POCKET_BASE_URL}/
|
|
||||||
- https://${FRONT_URL}/
|
|
@ -1,64 +0,0 @@
|
|||||||
# This Dockerfile allows you to run AstroJS in server mode
|
|
||||||
|
|
||||||
#########
|
|
||||||
# Build #
|
|
||||||
#########
|
|
||||||
FROM docker.io/node:20-alpine as BUILD_IMAGE
|
|
||||||
|
|
||||||
# Disable telemetry
|
|
||||||
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
||||||
|
|
||||||
# External deps (for node-gyp add: "python3 make g++")
|
|
||||||
RUN apk add --no-cache git
|
|
||||||
|
|
||||||
# run as non root user
|
|
||||||
USER node
|
|
||||||
|
|
||||||
# go to user repository
|
|
||||||
WORKDIR /home/node
|
|
||||||
|
|
||||||
# Add package json
|
|
||||||
ADD --chown=node:node package.json package-lock.json ./
|
|
||||||
|
|
||||||
# install dependencies from package lock
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Add project files
|
|
||||||
ADD --chown=node:node . .
|
|
||||||
|
|
||||||
# build
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# remove dev deps
|
|
||||||
RUN npm prune --omit=dev
|
|
||||||
|
|
||||||
##############
|
|
||||||
# Production #
|
|
||||||
##############
|
|
||||||
FROM docker.io/node:20-alpine as PROD_IMAGE
|
|
||||||
|
|
||||||
# inform software to be in production
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV HOST=0.0.0.0
|
|
||||||
ENV RESOURCES_FOLDER=/home/node/.loop/uploads
|
|
||||||
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
||||||
|
|
||||||
# run as non root user
|
|
||||||
USER node
|
|
||||||
|
|
||||||
# go to work folder
|
|
||||||
WORKDIR /home/node
|
|
||||||
|
|
||||||
# Expose port
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
# Add Healthcheck
|
|
||||||
HEALTHCHECK --interval=10s --timeout=10s --start-period=5s --retries=3 CMD wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
|
|
||||||
|
|
||||||
# copy from build image
|
|
||||||
COPY --chown=node:node --from=BUILD_IMAGE /home/node/node_modules ./node_modules
|
|
||||||
COPY --chown=node:node --from=BUILD_IMAGE /home/node/dist ./dist
|
|
||||||
COPY --chown=node:node --from=BUILD_IMAGE /home/node/package.json /home/node/.env* ./
|
|
||||||
|
|
||||||
# run it !
|
|
||||||
CMD ["npm", "run", "start"]
|
|
@ -1,30 +1,20 @@
|
|||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
import node from '@astrojs/node';
|
|
||||||
import tailwind from "@astrojs/tailwind";
|
|
||||||
|
|
||||||
import react from "@astrojs/react";
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// integrations: [tailwind(), test, routing(), version(), buildInfos()],
|
// integrations: [tailwind(), test, routing(), version(), buildInfos()],
|
||||||
compressHTML: true,
|
compressHTML: true,
|
||||||
build: {
|
build: {
|
||||||
assets: 'assets',
|
assets: 'assets',
|
||||||
inlineStylesheets: 'auto'
|
inlineStylesheets: 'auto'
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
port: 3000
|
port: 3000
|
||||||
},
|
},
|
||||||
trailingSlash: 'never',
|
trailingSlash: 'never',
|
||||||
output: 'server',
|
output: 'static', //'server',
|
||||||
adapter: node({
|
// adapter: node({
|
||||||
mode: 'standalone'
|
// mode: 'standalone'
|
||||||
}),
|
// }),
|
||||||
integrations: [tailwind(), react()],
|
});
|
||||||
vite: {
|
|
||||||
optimizeDeps: {
|
|
||||||
include: ['leaflet']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
1181
front/package-lock.json
generated
1181
front/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -2,43 +2,32 @@
|
|||||||
"name": "front",
|
"name": "front",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"private": "true",
|
"private":"true",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "node ./dist/server/entry.mjs",
|
"start": "astro dev",
|
||||||
"build": "astro check && astro build",
|
"build": "astro check && astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro",
|
"astro": "astro"
|
||||||
"check:lint": "eslint src"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/node": "^8.2.5",
|
|
||||||
"@astrojs/react": "^3.3.1",
|
|
||||||
"@astrojs/tailwind": "^5.1.0",
|
"@astrojs/tailwind": "^5.1.0",
|
||||||
"@tailwindcss/typography": "^0.5.12",
|
"@tailwindcss/typography": "^0.5.12",
|
||||||
"@types/react": "^18.2.79",
|
"astro": "^4.6.3",
|
||||||
"@types/react-dom": "^18.2.25",
|
|
||||||
"astro": "4.5.12",
|
|
||||||
"leaflet": "^1.9.4",
|
|
||||||
"lucide-astro": "^0.372.0",
|
"lucide-astro": "^0.372.0",
|
||||||
"pocketbase": "^0.21.1",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"react-leaflet": "^4.2.1",
|
|
||||||
"simple-icons-astro": "^11.12.0",
|
"simple-icons-astro": "^11.12.0",
|
||||||
"tailwindcss": "^3.4.3",
|
"tailwindcss": "^3.4.3",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/check": "^0",
|
"@astrojs/check": "^0",
|
||||||
"@types/leaflet": "^1.9.12",
|
"@types/node": "^20",
|
||||||
"@types/node": "^20",
|
"@typescript-eslint/eslint-plugin": "^6",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
"@typescript-eslint/parser": "^6",
|
||||||
"@typescript-eslint/parser": "^6.21.0",
|
"@vitest/coverage-v8": "^1",
|
||||||
"@vitest/coverage-v8": "^1",
|
"eslint": "^8",
|
||||||
"eslint": "^8.57.0",
|
"eslint-plugin-astro": "^0.31",
|
||||||
"eslint-plugin-astro": "^0.31.4",
|
"typescript": "^5",
|
||||||
"typescript": "^5",
|
"vitest": "^1"
|
||||||
"vitest": "^1"
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
import type { string } from 'astro/zod'
|
|
||||||
import type { Marker } from 'leaflet'
|
|
||||||
|
|
||||||
export interface Props {
|
|
||||||
latitude: number
|
|
||||||
longitude: number
|
|
||||||
zoom: number
|
|
||||||
/** the DOM ID of a <div> element */
|
|
||||||
container: string
|
|
||||||
/** https://leafletjs.com/reference.html#tilelayer */
|
|
||||||
tileLayer: string
|
|
||||||
/** Most tile servers require attribution. */
|
|
||||||
attribution: string
|
|
||||||
containerstyle?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const { latitude, longitude, zoom, container, tileLayer, attribution, containerstyle = "height: 61.8vh", class } = Astro.props
|
|
||||||
---
|
|
||||||
|
|
||||||
<leaflet-map
|
|
||||||
data-latitude={latitude}
|
|
||||||
data-longitude={longitude}
|
|
||||||
data-zoom={zoom}
|
|
||||||
data-container={container}
|
|
||||||
data-tiles={tileLayer}
|
|
||||||
data-attribution={attribution}
|
|
||||||
data-containerstyle={containerstyle}
|
|
||||||
>
|
|
||||||
|
|
||||||
<div id={container} style={containerstyle}></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import L, { type LatLngTuple } from "leaflet"
|
|
||||||
import "leaflet/dist/leaflet"
|
|
||||||
import "leaflet/dist/leaflet.css"
|
|
||||||
|
|
||||||
|
|
||||||
class LeafletMap extends HTMLElement {
|
|
||||||
constructor() {
|
|
||||||
super()
|
|
||||||
|
|
||||||
const latlng = [Number(this.dataset.latitude), Number(this.dataset.longitude)] as LatLngTuple
|
|
||||||
|
|
||||||
var map = L.map(this.dataset.container as string).setView(latlng, Number(this.dataset.zoom))
|
|
||||||
L.tileLayer(
|
|
||||||
this.dataset.tiles as string,
|
|
||||||
{attribution: this.dataset.attribution}
|
|
||||||
).addTo(map)
|
|
||||||
var marker = L.marker([51.5, -0.09]).addTo(map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.customElements.define("leaflet-map", LeafletMap);
|
|
||||||
</script>
|
|
@ -20,3 +20,32 @@ const { title } = Astro.props;
|
|||||||
<slot />
|
<slot />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
<style is:global>
|
||||||
|
:root {
|
||||||
|
--accent: 136, 58, 234;
|
||||||
|
--accent-light: 224, 204, 250;
|
||||||
|
--accent-dark: 49, 10, 101;
|
||||||
|
--accent-gradient: linear-gradient(
|
||||||
|
45deg,
|
||||||
|
rgb(var(--accent)),
|
||||||
|
rgb(var(--accent-light)) 30%,
|
||||||
|
white 60%
|
||||||
|
);
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
background: #13151a;
|
||||||
|
background-size: 224px;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
font-family:
|
||||||
|
Menlo,
|
||||||
|
Monaco,
|
||||||
|
Lucida Console,
|
||||||
|
Liberation Mono,
|
||||||
|
DejaVu Sans Mono,
|
||||||
|
Bitstream Vera Sans Mono,
|
||||||
|
Courier New,
|
||||||
|
monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
//référence a loop
|
|
||||||
//fonction get user pour récupéré un utilisateur (notament coté client)
|
|
||||||
//sessionID = JWS
|
|
||||||
|
|
||||||
|
|
||||||
//fonction set user crée un cookies de session
|
|
||||||
//passé le cookies astro dans les paramètre
|
|
||||||
|
|
||||||
//utiliser cookie.set pour crée un nouveau cookies
|
|
||||||
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
import Leaflet from 'components/Leaflet.astro';
|
|
||||||
import Layout from 'layouts/Layout.astro';
|
|
||||||
// import { Marker, Popup } from 'leaflet';
|
|
||||||
// import type { only } from 'node:test';
|
|
||||||
// import { MapContainer, TileLayer } from 'react-leaflet'
|
|
||||||
---
|
|
||||||
|
|
||||||
<Layout title="maps test">
|
|
||||||
|
|
||||||
<!-- <MapContainer client:only="react" center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
|
|
||||||
<TileLayer
|
|
||||||
client:only="react"
|
|
||||||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
||||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
||||||
/>
|
|
||||||
<Marker client:only="react" lat={51.505} lng={-0.09}>
|
|
||||||
<Popup client:only="react">
|
|
||||||
A pretty CSS3 popup. <br /> Easily customizable.
|
|
||||||
</Popup>
|
|
||||||
</Marker>
|
|
||||||
</MapContainer> -->
|
|
||||||
|
|
||||||
<Leaflet
|
|
||||||
latitude={51.505}
|
|
||||||
longitude={-0.09}
|
|
||||||
zoom={13}
|
|
||||||
container="leafletmap"
|
|
||||||
tileLayer="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
||||||
attribution="© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors">
|
|
||||||
</Leaflet>
|
|
||||||
</Layout>
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
import Layout from 'layouts/Layout.astro';
|
import Layout from '../layouts/Layout.astro';
|
||||||
import Card from 'components/Card.astro';
|
import Card from '../components/Card.astro';
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Welcome to Astro.">
|
<Layout title="Welcome to Astro.">
|
@ -1,8 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
export default {
|
|
||||||
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
|
|
||||||
theme: {
|
|
||||||
extend: {},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
}
|
|
@ -1,8 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict"
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": "src",
|
|
||||||
// hide an issue with typescript
|
|
||||||
"noUnusedLocals": false
|
|
||||||
},
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user