mirror of
https://github.com/DCsunset/taskwarrior-webui.git
synced 2025-08-18 21:43:06 +02:00
feat(docker): add docker build
This commit is contained in:
parent
83d6f1a13c
commit
380933e710
2 changed files with 39 additions and 0 deletions
34
Dockerfile
Normal file
34
Dockerfile
Normal file
|
@ -0,0 +1,34 @@
|
|||
FROM alpine:latest
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
# Debug
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
|
||||
|
||||
RUN apk --no-cache add nodejs npm nginx task
|
||||
|
||||
COPY ./frontend /src/frontend
|
||||
COPY ./backend /src/backend
|
||||
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY ./docker/start.sh /start.sh
|
||||
|
||||
# Debug
|
||||
RUN npm config set registry https://registry.npm.taobao.org
|
||||
|
||||
# Frontend
|
||||
RUN cd /src/frontend && npm install \
|
||||
&& npm run build && npm run export \
|
||||
&& cp -r /src/frontend/dist /static \
|
||||
&& rm -r /src/frontend
|
||||
|
||||
# Backend
|
||||
RUN cd /src/backend && npm install \
|
||||
&& npm run build \
|
||||
&& rm -r /src/backend/src
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# Taskwarrior data volumn
|
||||
VOLUME [ "/.task", "/.taskrc" ]
|
||||
|
||||
CMD ["/start.sh"]
|
5
docker/start.sh
Executable file
5
docker/start.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
mkdir -p /run/nginx
|
||||
cd /src/backend
|
||||
npm start &
|
||||
nginx -g 'daemon off;'
|
Loading…
Add table
Add a link
Reference in a new issue