Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
FROM ubuntu:jammy
FROM debian:bookworm

USER root
RUN adduser --system mt
ARG NODE_VERSION=14.21.3
RUN test -n "$NODE_VERSION" || ( echo "NODE_VERSION build argument is not defined" >&2 && exit 1 )

RUN apt-get update
RUN apt-get install --quiet --yes curl
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update
RUN apt-get install --quiet --yes nodejs git
RUN apt-get -y update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
xz-utils

ENV PATH="/usr/local/node/bin:/usr/local/node/sbin:${PATH}"

RUN arch="$( if [ "$(uname -m)" = "aarch64" ]; then echo "arm64"; else echo "x64"; fi )" && \
mkdir /usr/local/node && cd /usr/local/node && \
echo https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${arch}.tar.xz && \
curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${arch}.tar.xz | tar -xJ --strip-components=1

RUN adduser --system --shell /bin/bash --home /home/mt/ mt
USER mt
WORKDIR /home/mt

RUN curl https://install.meteor.com/ | sh

WORKDIR /home/mt
RUN git clone https://github.com/ThaumRystra/DiceCloud dicecloud
WORKDIR /home/mt/dicecloud
COPY --chown=mt ./app ./app
WORKDIR /home/mt/dicecloud/app

RUN npm install --production
ENV PATH=$PATH:/home/mt/.meteor
ENV PATH=${PATH}:/home/mt/.meteor
RUN meteor build --directory ~/dc/ --architecture os.linux.x86_64

WORKDIR /home/mt/dc/bundle/programs/server
RUN npm install

WORKDIR /home/mt/dc/bundle
RUN rm -r /home/mt/dicecloud

ENTRYPOINT node main.js
COPY ./README.md ./
COPY ./License.md ./

ENTRYPOINT ["node", "main.js"]