-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
FROM node:alpine | ||
# Stage 1: Build the Vue application | ||
FROM node:alpine AS build | ||
|
||
WORKDIR /app | ||
|
||
# Copy package files and install dependencies | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
|
||
# Copy the rest of your application code | ||
COPY . . | ||
|
||
RUN npm run build | ||
# Build the Vue application | ||
RUN npm run build:standalone | ||
|
||
# Stage 2: Serve the application with Nginx | ||
FROM nginx:alpine | ||
|
||
# Copy the built Vue application from the previous stage | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# Copy custom Nginx configuration if needed | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expose port 80 for the Nginx server | ||
EXPOSE 80 | ||
|
||
CMD npm run serve:standalone | ||
# Nginx will run automatically | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
root /usr/share/nginx/html; | ||
index main.ts; | ||
include /etc/nginx/mime.types; | ||
|
||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
location / { | ||
# add_header Access-Control-Allow-Origin "${TEILER_ORCHESTRATOR_URL}"; # To be added for running within the Teiler | ||
try_files $uri $uri/ /index.html; | ||
add_header Cache-Control "no-cache"; | ||
} | ||
|
||
location ^~ /config/ { | ||
add_header Cache-Control "no-cache"; | ||
add_header X-Content-Type-Options nosniff; | ||
} | ||
|
||
location ~ \.(css|js|woff|woff2|png|svg|jpg|jpeg)$(.*) { | ||
expires max; | ||
# add_header Access-Control-Allow-Origin "${TEILER_ORCHESTRATOR_URL}"; # To be added for running within the Teiler | ||
add_header Cache-Control "public"; | ||
add_header X-Content-Type-Options nosniff; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters