1
0
Fork 0

Fix Docker

pull/17/head
Ambrose Chua 2021-05-07 22:15:50 +08:00
parent 117a99ff9a
commit 8672207a2c
5 changed files with 17 additions and 42 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.git
Dockerfile*

View File

@ -1,16 +1,16 @@
FROM node:9-stretch
FROM node:16-buster
RUN apt-get update \
&& apt-get install -y build-essential zip unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
&& apt-get install -y \
build-essential zip unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY . /src
RUN cd /src \
&& yarn install \
&& yarn cache clean
COPY . /usr/local/share/file-manager
RUN cd /usr/local/share/file-manager \
&& npm install .
VOLUME /data
WORKDIR /data
CMD ["node", "/src/index.js"]
CMD ["node", "/usr/local/share/file-manager/index.js"]

View File

@ -1,19 +1,11 @@
FROM registry.makerforce.io/ambrose/env
FROM serverwentdown/env:alpine-node
USER root
RUN apk add --no-cache \
build-base \
python2
COPY . /usr/local/fm
RUN cd /usr/local/fm \
&& /home/ambrose/.local/bin/yarn install \
&& /home/ambrose/.local/bin/yarn cache clean
COPY . /usr/local/share/file-manager
RUN cd /usr/local/share/file-manager \
&& sudo npm install .
USER ambrose
ENV SHELL="zsh -l"
CMD ["node", "/usr/local/fm/index.js"]
CMD ["node", "/usr/local/share/file-manager/index.js"]

View File

@ -1,19 +0,0 @@
FROM registry.makerforce.io/ambrose/pwn
USER root
RUN apk add --no-cache \
build-base \
python2
COPY . /usr/local/fm
RUN cd /usr/local/fm \
&& /home/ambrose/.local/bin/yarn install \
&& /home/ambrose/.local/bin/yarn cache clean
USER ambrose
ENV SHELL="zsh -l"
CMD ["node", "/usr/local/fm/index.js"]

View File

@ -36,7 +36,7 @@ app.engine("handlebars", hbs({
helpers: {
either: (a, b, options) => {
if (a || b) {
return options.fn();
return options.fn(this);
}
},
filesize: filesize,