Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nginx-spa): add nginx-spa image #36

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions images/nginx-spa/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:stable-alpine

RUN sed -i '1idaemon off;' /etc/nginx/nginx.conf

COPY images/nginx-spa/nginx.conf /etc/nginx/conf.d/default.conf

ENTRYPOINT ["nginx"]
16 changes: 16 additions & 0 deletions images/nginx-spa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# node-distroless

This image combines the compactness and security of distroless with the convenience of dumb-init for process management, making Node.js applications run more stably in a container environment.

> This image is maintained with node latest LTS version

## Usage

The simple usage example

```dockerfile
FROM ghcr.io/ebizbase/node-distroless
WORKDIR /usr/src/app
COPY . .
CMD [ "index.js" ]
```
20 changes: 20 additions & 0 deletions images/nginx-spa/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 80 default_server;

gzip on;
gzip_min_length 1000;
gzip_types text/plain text/xml application/javascript text/css;

root /app;

location / {
add_header Cache-Control "no-store";
try_files $uri $uri/index.html /index.html;
}

location ~ \.(?!html) {
add_header Cache-Control "public, max-age=2678400";
try_files $uri =404;
}

}
39 changes: 39 additions & 0 deletions images/nginx-spa/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "nginx-spa",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"metadata": {
"version": "1.0.0",
"registries": ["ghcr.io", "docker.io"],
"namespace": "ebizbase/nginx-spa",
"labels": {
"org.opencontainers.image.source": "https://github.com/ebizbase/dev-infras",
"org.opencontainers.image.description": "Nginx image for SPA",
"org.opencontainers.image.licenses": "MIT"
}
},
"tags": [],
"targets": {
"build": {
"executor": "@ebizbase/nx-docker:build",
"options": {
"load": true,
"tags": ["edge"]
}
},
"test": {
"dependsOn": ["build"],
"executor": "nx:run-commands",
"options": {
"command": "docker run --rm ebizbase/nginx-spa:edge -T"
}
},
"publish": {
"executor": "@ebizbase/nx-docker:build",
"options": {
"push": true,
"tags": ["latest", "{major}", "{major}.{minor}", "{major}.{minor}.{patch}"]
}
}
}
}
10 changes: 10 additions & 0 deletions release-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@
"jsonpath": "$.metadata.version"
}
]
},
"images/nginx-spa": {
"package-name": "nginx-spa",
"extra-files": [
{
"type": "json",
"path": "project.json",
"jsonpath": "$.metadata.version"
}
]
}
}
}
3 changes: 2 additions & 1 deletion release-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"devcontainer-images/node-dind-devcontainer": "1.0.0",
"devcontainer-images/node-dind-playwright-devcontainer": "1.0.0",
"devcontainer-images/node-playwright-devcontainer": "1.0.0",
"images/node-distroless": "1.0.0"
"images/node-distroless": "1.0.0",
"images/nginx-spa": "0.0.0"
}
Loading