Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zakimohammed/ng-docker-mark-4
Brotli enabled project for Angular and Docker powered by Cirrus UI.
https://github.com/zakimohammed/ng-docker-mark-4
angular brotli cirrus-ui docker dockerfile nginx nginx-docker
Last synced: about 2 months ago
JSON representation
Brotli enabled project for Angular and Docker powered by Cirrus UI.
- Host: GitHub
- URL: https://github.com/zakimohammed/ng-docker-mark-4
- Owner: ZakiMohammed
- Created: 2023-07-15T13:21:25.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-19T15:18:19.000Z (over 1 year ago)
- Last Synced: 2023-07-19T16:29:50.942Z (over 1 year ago)
- Topics: angular, brotli, cirrus-ui, docker, dockerfile, nginx, nginx-docker
- Language: TypeScript
- Homepage: https://codeomelet.com/posts/brotli-dockerized-angular-app-with-nginx-ngdocker
- Size: 194 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Brotli Dockerized Angular App | NgDocker - Mark 4
Check out the CodeOmelet blog post for this project.
Link: https://codeomelet.com/posts/brotli-dockerized-angular-app-with-nginx-ngdocker
___Gzip project for Angular and Docker powered by Cirrus UI.
## Build Docker Image and Run Docker Container
```
# build image
docker build -t ng-docker:mark-4 .# run container
docker run -p 3300:80 --name ng-docker-mark-4-container ng-docker:mark-4# list images
docker image ls# stop container
docker stop ng-docker-mark-4-container# remove container
docker rm ng-docker-mark-4-container
```## nginx\nginx.conf
```
server {
brotli on;
brotli_static on;listen 80;
root /usr/share/nginx/html;
location / {
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
```## Dockerfile
```
# Build container
FROM node:18-alpine AS builder
WORKDIR /app# Make sure we got brotli
RUN apk update
RUN apk add --upgrade brotli# NPM install and build
ADD package.json .
RUN npm install
ADD . .
RUN npm run build:prodRUN cd /app/dist && find . -type f -exec brotli {} \;
# Actual runtime container
FROM alpine
RUN apk add brotli nginx nginx-mod-http-brotli# Minimal config
COPY nginx/nginx.conf /etc/nginx/http.d/default.conf# Actual data
COPY --from=builder /app/dist/ng-docker-mark-4 /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80
```