chore: initialize frontend repo with teaching terminology updates
Add the current frontend codebase with a baseline .gitignore and update piano-specific UI terms to teaching-oriented terms for the current product context. Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# build
|
||||
FROM node:12-alpine
|
||||
COPY . /root/website
|
||||
WORKDIR /root/website
|
||||
RUN yarn && yarn run build
|
||||
|
||||
# serve
|
||||
FROM nginx:1.19.6-alpine
|
||||
# setup timezone
|
||||
RUN apk update && apk add tzdata sed bash
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
RUN echo 'Asia/Shanghai' > /etc/timezone
|
||||
RUN mkdir -p /root/logs /run/nginx/
|
||||
# copy scripts
|
||||
COPY container/*.sh /root/
|
||||
RUN ls /root
|
||||
COPY container/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=0 /root/website/dist /home/nginx/website
|
||||
RUN /root/setup.sh
|
||||
ENTRYPOINT /root/init.sh
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
echo "UC_PORT: ${UC_PORT}"
|
||||
echo "WS_PORT: ${WS_PORT}"
|
||||
|
||||
# shellcheck disable=SC2044
|
||||
for FILE in $(find /etc/nginx/conf.d/*); do
|
||||
sed -i -e "s|UC_PORT|${UC_PORT}|" -e "s|WS_PORT|${WS_PORT}|" "${FILE}"
|
||||
done
|
||||
|
||||
/usr/sbin/nginx
|
||||
sh
|
||||
@@ -0,0 +1,17 @@
|
||||
server {
|
||||
listen 8010;
|
||||
server_name localhost;
|
||||
|
||||
root /home/nginx/website;
|
||||
index index.html;
|
||||
|
||||
location /ws/ {
|
||||
proxy_pass http://htyws:WS_PORT;
|
||||
}
|
||||
location /uc/ {
|
||||
proxy_pass http://htyuc:UC_PORT;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
if [[ ! -d "/home/nginx" ]]; then
|
||||
mkdir /home/nginx
|
||||
chown nginx:nginx /home/nginx/
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user