diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cc7b141 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,42 @@ +# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. + +# Compiled output +/dist +/tmp +/out-tsc +/bazel-out + +# Node +/node_modules +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings + +# System files +.DS_Store +Thumbs.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a44ba8b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:23-alpine AS build + +ARG config production + +WORKDIR /src +COPY package*.json . + +RUN npm install -g @angular/cli +RUN npm install + +COPY . /src +RUN ng build \ + --configuration=${config} \ + --delete-output-path false + +FROM nginx:alpine-slim + +COPY --from=build /src/dist/ui/browser/ /usr/share/nginx/html + +COPY nginx/default.conf /etc/nginx/conf.d/ + +EXPOSE 80 diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..fe9ef0d --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}