Skip to content

Commit

Permalink
Merge branch 'master' into makdown-for-community
Browse files Browse the repository at this point in the history
  • Loading branch information
carleshf committed Apr 24, 2024
2 parents 4da1a6b + 997c536 commit 3388164
Show file tree
Hide file tree
Showing 21 changed files with 28,450 additions and 20,289 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
node_modules
dist
!*/.empty
35 changes: 35 additions & 0 deletions Dockerfile.devci
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#stage 1
FROM node:20 as node
WORKDIR /app
#define env vars
ARG ENVIRONMENT=openebench
ARG OEB_LEGACY_ANGULAR_URI=https://legacy.openebench.bsc.es/
ARG VRE_URI=https://openebench.bsc.es/vre/home/
ARG OBSERVATORY_URI=https://observatory.openebench.bsc.es
ARG REST_API_URL=https://openebench.bsc.es/monitor/rest/
ARG SCIENTIFIC_SERVICE_URL=https://openebench.bsc.es/api/scientific
ARG BENCH_EVENT_API_URL=https://openebench.bsc.es/rest/bench_event_api
ARG KEYCLOAK_HOST=https://inb.bsc.es
ARG KEYCLOAK_REALM=openebench
ARG KEYCLOAK_CLIENT_ID=oeb-frontend
ARG OBSERVATORY_API_URL=https://observatory.openebench.bsc.es/api/stats
ENV ENVIRONMENT $ENVIRONMENT
ENV OEB_LEGACY_ANGULAR_URI $OEB_LEGACY_ANGULAR_URI
ENV VRE_URI $VRE_URI
ENV OBSERVATORY_URI $OBSERVATORY_URI
ENV REST_API_URL $REST_API_URL
ENV SCIENTIFIC_SERVICE_URL $SCIENTIFIC_SERVICE_URL
ENV BENCH_EVENT_API_URL $BENCH_EVENT_API_URL
ENV KEYCLOAK_HOST $KEYCLOAK_HOST
ENV KEYCLOAK_REALM $KEYCLOAK_REALM
ENV KEYCLOAK_CLIENT_ID $KEYCLOAK_CLIENT_ID
ENV OBSERVATORY_API_URL $OBSERVATORY_API_URL
ENV NODE_OPTIONS --openssl-legacy-provider

COPY . .

RUN npm ci

EXPOSE 3000

CMD ["npm", "run", "dev"]
5 changes: 3 additions & 2 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#stage 1
FROM node:14 as node
FROM node:20 as node
WORKDIR /app
#define env vars
ARG ENVIRONMENT=dev-openebench
Expand All @@ -24,8 +24,9 @@ ENV KEYCLOAK_HOST $KEYCLOAK_HOST
ENV KEYCLOAK_REALM $KEYCLOAK_REALM
ENV KEYCLOAK_CLIENT_ID $KEYCLOAK_CLIENT_ID
ENV OBSERVATORY_API_URL $OBSERVATORY_API_URL
ENV NODE_OPTIONS --openssl-legacy-provider
COPY . .
RUN npm install
RUN npm ci
RUN npm run build
RUN npm run generate
#stage 2
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.develop2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#stage 1
FROM node:14 as node
FROM node:20 as node
WORKDIR /app
#define env vars
ARG ENVIRONMENT=dev2-openebench
Expand All @@ -24,8 +24,9 @@ ENV KEYCLOAK_HOST $KEYCLOAK_HOST
ENV KEYCLOAK_REALM $KEYCLOAK_REALM
ENV KEYCLOAK_CLIENT_ID $KEYCLOAK_CLIENT_ID
ENV OBSERVATORY_API_URL $OBSERVATORY_API_URL
ENV NODE_OPTIONS --openssl-legacy-provider
COPY . .
RUN npm install
RUN npm ci
RUN npm run build
RUN npm run generate
#stage 2
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#stage 1
FROM node:14 as node
FROM node:20 as node
WORKDIR /app
#define env vars
ARG ENVIRONMENT=openebench
Expand All @@ -24,8 +24,9 @@ ENV KEYCLOAK_HOST $KEYCLOAK_HOST
ENV KEYCLOAK_REALM $KEYCLOAK_REALM
ENV KEYCLOAK_CLIENT_ID $KEYCLOAK_CLIENT_ID
ENV OBSERVATORY_API_URL $OBSERVATORY_API_URL
ENV NODE_OPTIONS --openssl-legacy-provider
COPY . .
RUN npm install
RUN npm ci
RUN npm run build
RUN npm run generate
#stage 2
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The respective docker compose files for the oeb landscape can be found in this r

```bash
# install dependencies
$ npm install
$ npm ci
# serve with hot reload at localhost:3000
$ npm run dev
Expand Down Expand Up @@ -127,3 +127,13 @@ More information about the usage of this directory in [the documentation](https:
This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store).

# Local development CI deployment (for developers!!!)

If you want to locally develop, you can use `docker compose`:

```bash
docker compose -f docker-compose.devci.yml up
```

Then, the continuous integration server is available both at 3000 and 8080.
4 changes: 4 additions & 0 deletions components/Cards/CommunityCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export default {
type: Array,
required: true,
},
summary: {
type: String,
required: true,
},
to: {
type: String,
required: true,
Expand Down
Empty file added dist/.empty
Empty file.
42 changes: 42 additions & 0 deletions docker-compose.devci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '3'
volumes:
dist-volume:
node-modules-volume:
services:
nuxt:
build:
context: .
dockerfile: Dockerfile.devci
image: openebench-nuxt:devci
restart: on-failure
volumes:
- ./assets:/app/assets:ro
- ./components:/app/components:ro
- ./config:/app/config:ro
- ./layouts:/app/layouts:ro
- ./pages:/app/pages:ro
- ./plugins:/app/plugins:ro
- ./static:/app/static
- ./store:/app/store:ro
- ./stories:/app/stories:ro
- ./test:/app/test:ro
- ./jest.config.js:/app/jest.config.js:ro
- ./nuxt.config.js:/app/nuxt.config.js:ro
- ./package.json:/app/package.json:ro
- ./package-lock.json:/app/package-lock.json
- ./stylelint.config.js:/app/stylelint.config.js:ro
- ./tsconfig.json:/app/tsconfig.json:ro

- node-modules-volume:/app/node_modules
- dist-volume:/app/dist
ports:
- '3000:3000'
proxy:
image: nginx:alpine
depends_on:
- nuxt
volumes:
- dist-volume:/usr/share/nginx/html/:ro
- ./nginx.conf.devci:/etc/nginx/conf.d/default.conf:ro
ports:
- '8080:80'
23 changes: 23 additions & 0 deletions nginx.conf.devci
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
server {
listen 80;
sendfile on;
default_type application/octet-stream;

location / {
proxy_pass http://nuxt:3000/;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_buffering off;
proxy_request_buffering off;

# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
Empty file added node_modules/.empty
Empty file.
7 changes: 7 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export default {
// Target: https://go.nuxtjs.dev/config-target
target: 'static',

telemetry: false,

server: {
host: '0.0.0.0',
timing: false,
},

// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: '%s - openEBench-nuxt',
Expand Down
Loading

0 comments on commit 3388164

Please sign in to comment.