Skip to content

Commit

Permalink
#63 docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Werfling committed Feb 29, 2024
1 parent 110f79c commit 38b9ef0
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 67 deletions.
50 changes: 30 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,67 +90,77 @@ RUN mkdir -p /opt/flyingfish
RUN mkdir -p /var/log/flyingfish
RUN mkdir -p /var/lib/flyingfish

# Copy/Install Schemas ----------------------------------------------------------------------------------------------------
# Copy Schemas ---------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/schemas

COPY ./schemas/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Core ----------------------------------------------------------------------------------------------------
# Copy Core ------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/core

COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build
# Copy Plugins ---------------------------------------------------------------------------------------------------------

# Copy/Install DemoPlugin ----------------------------------------------------------------------------------------------
WORKDIR /opt/flyingfish/plugins
COPY ./plugins/package.json ./

WORKDIR /opt/flyingfish/plugins/letsencrypt
RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

WORKDIR /opt/flyingfish/plugins/letsencrypt
COPY ./plugins/letsencrypt/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Backend -------------------------------------------------------------------------------------------------
# Copy/ Backend --------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/backend

COPY backend ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Frontend ------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/frontend

COPY frontend ./

RUN rm -R ./node_modules | true
RUN rm -R ./dist | true
RUN rm ./package-lock.json | true

# Install All ----------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish
COPY ./package.json ./
RUN npm install

WORKDIR /opt/flyingfish/schemas
RUN npm run build

WORKDIR /opt/flyingfish/core
RUN npm run build

WORKDIR /opt/flyingfish/plugins/letsencrypt
RUN npm run build

WORKDIR /opt/flyingfish/backend
RUN npm run build

WORKDIR /opt/flyingfish/frontend
RUN npm install --force
RUN npm run gulp-copy-data
RUN npm run gulp-build-webpack
Expand Down
31 changes: 18 additions & 13 deletions ddnsserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,51 @@ RUN mkdir -p /opt/flyingfish/ddnsserver/dist
RUN mkdir -p /opt/flyingfish/ddnsserver/node_modules
RUN mkdir -p /var/lib/flyingfish


# Copy/Install Schemas ----------------------------------------------------------------------------------------------------
# Copy Schemas ---------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/schemas

COPY ./schemas/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Core ----------------------------------------------------------------------------------------------------
# Copy Core ------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/core

COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install ddnsserver ----------------------------------------------------------------------------------------------
# Copy ddnsserver ------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/ddnsserver

COPY ./ddnsserver ./

RUN rm -R Dockerfile | true
RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

# Install --------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish
COPY ./package.json ./
RUN npm install

WORKDIR /opt/flyingfish/schemas
RUN npm run build

WORKDIR /opt/flyingfish/core
RUN npm run build

WORKDIR /opt/flyingfish/ddnsserver
RUN npm run build

# ----------------------------------------------------------------------------------------------------------------------

RUN npm install supervisor -g

EXPOSE 22
Expand Down
53 changes: 32 additions & 21 deletions himhip/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,62 @@ RUN apt-get upgrade -y
RUN apt-get install -y iproute2
RUN apt-get install -y net-tools

RUN mkdir -p /opt/schemas
RUN mkdir -p /opt/core
RUN mkdir -p /opt/app
RUN mkdir -p /opt/app/dist
RUN mkdir -p /opt/app/node_modules
# ----------------------------------------------------------------------------------------------------------------------

# Copy/Install Schemas ----------------------------------------------------------------------------------------------------
RUN mkdir -p /opt/flyingfish
RUN mkdir -p /opt/flyingfish/schemas
RUN mkdir -p /opt/flyingfish/core
RUN mkdir -p /opt/flyingfish/himhip
RUN mkdir -p /opt/flyingfish/himhip/dist
RUN mkdir -p /opt/flyingfish/himhip/node_modules

WORKDIR /opt/schemas
# Copy Schemas ---------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/schemas
COPY ./schemas/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Core ----------------------------------------------------------------------------------------------------

WORKDIR /opt/core
# Copy Core ------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/core
COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install HimHip --------------------------------------------------------------------------------------------------
# Copy HimHip ----------------------------------------------------------------------------------------------------------

WORKDIR /opt/app

COPY ./himhip/ ./
WORKDIR /opt/flyingfish/himhip
COPY ./himhip ./

RUN rm -R Dockerfile | true
RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

# Install --------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish
COPY ./package.json ./
RUN npm install

WORKDIR /opt/flyingfish/schemas
RUN npm run build

WORKDIR /opt/flyingfish/core
RUN npm run build

WORKDIR /opt/flyingfish/himhip
RUN npm run build

# ----------------------------------------------------------------------------------------------------------------------

RUN npm install supervisor -g

CMD [ "node", "dist/main.js", "--envargs=1"]
WORKDIR /opt/flyingfish

CMD [ "node", "himhip/dist/main.js", "--envargs=1"]
31 changes: 18 additions & 13 deletions sshserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,51 @@ RUN mkdir -p /opt/flyingfish/sshserver/node_modules
RUN mkdir -p /var/lib/flyingfish
RUN mkdir -p /var/lib/flyingfish/ssh


# Copy/Install Schemas ----------------------------------------------------------------------------------------------------
# Copy Schemas ---------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/schemas

COPY ./schemas/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install Core ----------------------------------------------------------------------------------------------------
# Copy Core ------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/core

COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install sshserver -----------------------------------------------------------------------------------------------
# Copy sshserver -------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish/sshserver

COPY ./sshserver ./

RUN rm -R Dockerfile | true
RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

# Install --------------------------------------------------------------------------------------------------------------

WORKDIR /opt/flyingfish
COPY ./package.json ./
RUN npm install

WORKDIR /opt/flyingfish/schemas
RUN npm run build

WORKDIR /opt/flyingfish/core
RUN npm run build

WORKDIR /opt/flyingfish/sshserver
RUN npm run build

# ----------------------------------------------------------------------------------------------------------------------

RUN npm install supervisor -g

EXPOSE 22
Expand Down

0 comments on commit 38b9ef0

Please sign in to comment.