This repository has been archived by the owner on Nov 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Bidaya0/ci/add-frontend-ci
ci(frontend): add build test.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.17 AS build-env | ||
ADD . /go/src/app | ||
WORKDIR /go/src/app | ||
RUN go install | ||
RUN go install github.com/gopherjs/gopherjs@latest | ||
RUN gopherjs build -m *.go -o ./main.js | ||
|
||
|
||
FROM nginx | ||
|
||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
COPY ./index.html /usr/share/nginx/html/ | ||
COPY --from=build-env /go/src/app/main.js /usr/share/nginx/html/ | ||
|
||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
worker_processes 1; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
gzip on; | ||
gzip_min_length 5k; | ||
gzip_buffers 4 16k; | ||
#gzip_http_version 1.0; | ||
gzip_comp_level 3; | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; | ||
gzip_vary on; | ||
|
||
server { | ||
listen 80; | ||
server_name iast.huoxian.cn; | ||
client_max_body_size 100M; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |