This commit is contained in:
root committed 2024-02-28 12:42:50 +02:00
commit 72c4d16448
37 files changed
+1126

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
ARG NGINX_IMAGE="nginx"
ARG NGINX_VERSION="alpine"
ARG NODE_IMAGE="node"
ARG NODE_VERSION="16.17.1-alpine"
## Builder image (builds the static content from JS sources)
FROM ${NODE_IMAGE}:${NODE_VERSION} AS appbuild
WORKDIR /app
COPY package.json package-lock.json /app/
RUN npm ci --no-audit --no-fund \
&& ls -la /app \
&& find /app ! -path '/app/node_modules/*'
COPY . /app/
RUN npm ci \
&& npm run build \
&& ls -la /app \
&& find /app ! -path '/app/node_modules/*'
## Client web server image
FROM ${NGINX_IMAGE}:${NGINX_VERSION}
COPY --from=appbuild app/build/ /usr/share/nginx/html/
# Copy the custom Nginx configuration
COPY default.conf /etc/nginx/conf.d/default.conf
RUN ls -la /usr/share/nginx/html/ \
&& chown root:root -R /usr/share/nginx/html/ \
&& chmod 755 -R /usr/share/nginx/html/ \
&& ls -la /usr/share/nginx/html/ \
&& find /usr/share/nginx/html/
+11
View File
@@ -0,0 +1,11 @@
ARG NODE_IMAGE="node"
ARG NODE_VERSION="16.17.1-alpine"
FROM ${NODE_IMAGE}:${NODE_VERSION} AS appbuild
WORKDIR /app
COPY . /app/
RUN npm test
+8
View File
@@ -0,0 +1,8 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
+4
View File
@@ -0,0 +1,4 @@
Dokckerfile
Dokckerfile.*
node_modules
dockerignore