diff --git a/Dockerfile b/Dockerfile index 5f7ff99b..3c42def2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,27 @@ -FROM ubuntu:latest -RUN apt-get update --quiet \ - && apt-get install --quiet --yes \ - bsdtar \ - curl \ - git -RUN ln --symbolic --force $(which bsdtar) $(which tar) -RUN useradd --create-home --shell /bin/bash dicecloud -USER dicecloud -WORKDIR /home/dicecloud -RUN curl https://install.meteor.com/?release=1.8.0.2 | sh -ENV PATH="${PATH}:/home/dicecloud/.meteor" -COPY dev.sh ./dev.sh -ENTRYPOINT ./dev.sh \ No newline at end of file +FROM ubuntu:jammy + +USER root +RUN adduser --system mt + +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 + +USER mt + +RUN curl https://install.meteor.com/ | sh + +WORKDIR /home/mt +RUN git clone https://github.com/ThaumRystra/DiceCloud dicecloud +WORKDIR /home/mt/dicecloud/app +RUN npm install --production +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 diff --git a/dev.sh b/dev.sh deleted file mode 100755 index a9931b0e..00000000 --- a/dev.sh +++ /dev/null @@ -1,4 +0,0 @@ -set -o errexit -o nounset -cd DiceCloud/app -meteor npm install -meteor diff --git a/docker-compose.yml b/docker-compose.yml index b3a27e39..b6f40f3e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,26 @@ -version: "3.7" +version: '3.7' services: - web: + dicecloud-db: + container_name: dicecloud-db + image: mongo:latest + command: + - --storageEngine=wiredTiger + volumes: + - ./dicecloud/data/db:/data/db + environment: + - MONGO_INITDB_ROOT_USERNAME=meteor + - MONGO_INITDB_ROOT_PASSWORD=meteor + dicecloud: + container_name: dicecloud build: context: ./ - volumes: - - .:/home/dicecloud/DiceCloud + environment: + #update ROOT_URL, PORT, and MAIL_URL for your environment + - ROOT_URL=http://localhost:3000 + - MONGO_URL=mongodb://meteor:meteor@dicecloud-db:27017 + - PORT=3000 + - NODE_ENV=production + - METEOR_SETTINGS={"public":{"environment":"production","disablePatreon":true}} + - MAIL_URL=smtp://EMAIL:PASSWORD@SERVER:PORT ports: - - "3000:3000" - - "3003:3003" - # entrypoint: /bin/bash - # stdin_open: true - # tty: true \ No newline at end of file + - '3000:3000' #The internal port should match the port set in the environmental variables \ No newline at end of file