-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.test
103 lines (80 loc) · 2.99 KB
/
Dockerfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# EXPOSE 3000
# CMD ["node", "run", "start"]#stage 1
FROM node:20 as build
WORKDIR /app
#define env vars
ARG ENVIRONMENT=test2-openebench
ARG APP_BASE_URL=https://localhost
ARG OEB_LEGACY_ANGULAR_URI=https://legacy.openebench.bsc.es/
ARG VRE_URI=https://dev-openebench.bsc.es/vre/home/
ARG OBSERVATORY_URI=https://observatory.openebench.bsc.es
ARG REST_API_URL=https://dev-openebench.bsc.es/monitor/rest/
ARG SCIENTIFIC_SERVICE_URL=https://dev-openebench.bsc.es/api/scientific/
ARG SCIENTIFIC_SERVICE_URL_API=https://dev-openebench.bsc.es/api/scientific/
ARG BENCH_EVENT_API_URL=https://dev-openebench.bsc.es/rest/bench_event_api
ARG KEYCLOAK_HOST=https://inb.bsc.es
ARG KEYCLOAK_REALM=dev-openebench
ARG KEYCLOAK_CLIENT_ID=oeb-frontend
ARG OBSERVATORY_API_URL=https://observatory.openebench.bsc.es/api
ARG GITHUBAPP_API_URL=https://observatory.openebench.bsc.es/githubapp/api
ARG AUTH_ORIGIN=https://inb.bsc.es
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 NUXT_SCIENTIFIC_SERVICE_URL $SCIENTIFIC_SERVICE_URL
ENV SCIENTIFIC_SERVICE_URL_API $SCIENTIFIC_SERVICE_URL_API
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 GITHUBAPP_API_URL $GITHUBAPP_API_URL
ENV APP_BASE_URL $APP_BASE_URL
ENV NODE_OPTIONS --openssl-legacy-provider
ENV AUTH_ORIGIN $AUTH_ORIGIN
COPY package*.json ./
COPY . .
RUN npm install && npm run build
# Etapa de producción
FROM nginx:latest
WORKDIR /app
COPY --from=build /app/.output /app/.output
# Copiar configuración de Nginx personalizada
COPY nginx_copy.conf /etc/nginx/conf.d/default.conf
# Instalar Node.js para ejecutar el servidor Nuxt 3
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean
# Exponer los puertos necesarios
EXPOSE 80 3000
# Inicia Nuxt 3 y Nginx
CMD node .output/server/index.mjs & nginx -g "daemon off;"
# COPY . .
# RUN npm ci
# RUN npm run buildf
# RUN npm run generate
# #stage 2
# FROM nginx:alpine
# COPY --from=build /app/.output/public /usr/share/nginx/html
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# EXPOSE 80
#stage 2
# FROM nginx:alpine
# # COPY --from=build /app/.output/public /usr/share/nginx/html
# # COPY nginx.conf /etc/nginx/conf.d/default.conf
# # EXPOSE 80
# # Install Node.js runtime for running the server
# RUN apk add --no-cache nodejs npm
# # Copy the custom Nginx configuration
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# # Copiar la aplicación generada desde la etapa de construcción
# COPY --from=build /app/.output/public /usr/share/nginx/html/public
# COPY --from=build /app/.output/server /usr/share/nginx/html/server
# # Expose port 80
# EXPOSE 3000
# EXPOSE 80
# # Start Nginx
# CMD ["sh", "-c", "npm run start & nginx -g 'daemon off;'"]