Skip to content

Commit a9151c4

Browse files
committedOct 20, 2024·
build web image
1 parent 321051d commit a9151c4

File tree

4 files changed

+95
-0
lines changed

4 files changed

+95
-0
lines changed
 

‎.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
node_modules
3+
.astro
4+
.git

‎.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
packages: write
12+
actions: read
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up buildx
21+
uses: docker/setup-buildx-action@v2
22+
23+
- name: Login to GitHub Container Registry
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push images
31+
uses: docker/build-push-action@v3
32+
with:
33+
context: .
34+
tags: ghcr.io/hpcslab/web:${{ github.sha }}
35+
push: true

‎Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM oven/bun:1 AS base
2+
3+
WORKDIR /work
4+
COPY . /work
5+
RUN bun install
6+
RUN bun run build
7+
8+
FROM nginx:1.27.1
9+
COPY nginx.conf /etc/nginx/nginx.conf
10+
COPY --from=base /work/dist /www

‎nginx.conf

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
worker_processes 8;
2+
error_log /dev/stderr;
3+
worker_rlimit_nofile 8192;
4+
5+
events {
6+
worker_connections 4096;
7+
}
8+
9+
http {
10+
include mime.types;
11+
index index.html;
12+
13+
default_type application/octet-stream;
14+
log_format json escape=json '{"time": "$time_iso8601",'
15+
'"host": "$remote_addr",'
16+
'"vhost": "$host",'
17+
'"user": "$remote_user",'
18+
'"status": "$status",'
19+
'"protocol": "$server_protocol",'
20+
'"method": "$request_method",'
21+
'"path": "$request_uri",'
22+
'"req": "$request",'
23+
'"size": "$body_bytes_sent",'
24+
'"reqtime": "$request_time",'
25+
'"apptime": "$upstream_response_time",'
26+
'"ua": "$http_user_agent",'
27+
'"forwardedfor": "$http_x_forwarded_for",'
28+
'"forwardedproto": "$http_x_forwarded_proto",'
29+
'"referrer": "$http_referer"}';
30+
access_log /dev/stdout json;
31+
sendfile on;
32+
tcp_nopush on;
33+
server_names_hash_bucket_size 128;
34+
gzip on;
35+
36+
server {
37+
listen 80;
38+
server_name www.hpcs.cs.tsukuba.ac.jp;
39+
access_log /dev/stdout json;
40+
location / {
41+
root /www;
42+
index index.html;
43+
try_files $uri $uri/index.html;
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)
Please sign in to comment.