halogenandtoast / ArkhamHorror

An unofficial rules-compliant browser based version of Arkham Horror: The Card Game. Not produced, endorsed, or supported by, or affiliated with Fantasy Flight Games.
https://arkhamhorror.app
110 stars 37 forks source link

Better explanation #79

Closed gustavoberman closed 2 years ago

gustavoberman commented 2 years ago

I'm not able to follow your instructions and try to run this in my computer. Can you please post a step by step? Thanks!

halogenandtoast commented 2 years ago

Hey, can you provide some details about your OS and what step you are stuck at.

gustavoberman commented 2 years ago

Hi there, I'm in ubuntu 20.04

This are the steps I understand I have to do: 1- git clone the repo 2- cd ArkhamHorror 3- docker build -t arkham .
(and wait a looong time)

Then, I need to install the following packages in my ubuntu: haskell-stack, postgresql, sqitch, npm

And follow with the steps: 4- cd backend 5- stack setup And it says:

The version of stack you are using (1.9.3.1) is outside the required version range specified in stack.yaml (>=2.3.1).

I understand I have the wrong version of haskell-stack. But this step is not done already in the dockerfile? If not: can it be done with a container so I don't have to install all that and mess with the haskell-stack version in ubuntu?

If I just jump that steps and go straight to the create database: cd ../migrations createdb arkham-horror-backend and it says: createdb: error: could not connect to database template1: FATAL: role "tavo" does not exist

I understand I have to setup postgres somehow. Again, can this be done in with a dockerfile?

Thanks!

halogenandtoast commented 2 years ago

So after building via docker, you should only need to run the command listed after building

docker run -t -i -e PORT=3000 -e DATABASE_URL="postgres://docker:docker@host.docker.internal:5432/arkham-horror-backend" -p 3000:3000 arkham

to run both the frontend and the backend. But the only requirement is that you have your own database running (this was chosen because this is roughly how I run the app in production). I can make a new dockerfile that includes postgres for those who want to run the app without any additional setup.

gustavoberman commented 2 years ago

That will be great!

halogenandtoast commented 2 years ago

Can you pull down the latest changes and try the following:

docker-compose up

then open http://localhost:3000

gustavoberman commented 2 years ago

docker compose up [+] Building 46.6s (15/48)
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 3.54kB 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 190B 0.0s => [internal] load metadata for docker.io/library/ubuntu:18.04 0.0s => [internal] load metadata for docker.io/library/node:lts 0.0s => [internal] load metadata for docker.io/fpco/stack-build:latest 0.0s => [internal] load build context 0.6s => => transferring context: 11.99MB 0.2s => [frontend 1/12] FROM docker.io/library/node:lts 1.2s => [dependencies 1/10] FROM docker.io/fpco/stack-build:latest 0.9s => [app 1/10] FROM docker.io/library/ubuntu:18.04 0.1s => CANCELED [app 2/10] RUN apt-get update && apt-get upgrade -y --as 46.2s => [dependencies 2/10] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localti 0.7s => [api 2/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && ech 0.6s => CANCELED [frontend 2/12] RUN npm install -g @vue/cli 45.1s => ERROR [api 3/11] RUN apt-get update && apt-get upgrade -y --assum 44.5s => CANCELED [dependencies 3/10] RUN apt-get update && apt-get upgrad 44.5s


[api 3/11] RUN apt-get update && apt-get upgrade -y --assume-yes && apt-get install -y --assume-yes libpq-dev postgresql && rm -rf /var/lib/apt/lists/*:

0 0.816 Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease [1,581 B]

0 0.894 Get:2 https://deb.nodesource.com/node_10.x bionic InRelease [4,584 B]

0 0.900 Err:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease

0 0.900 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC

0 1.115 Get:3 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]

0 1.212 Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]

0 2.510 Get:5 https://packages.confluent.io/deb/5.2 stable InRelease [5,872 B]

0 2.731 Get:6 https://deb.nodesource.com/node_10.x bionic/main amd64 Packages [767 B]

0 2.817 Get:7 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [22.8 kB]

0 3.150 Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [932 kB]

0 3.166 Get:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]

0 3.726 Get:10 https://packages.confluent.io/deb/5.2 stable/main amd64 Packages [44.6 kB]

0 4.515 Get:11 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]

0 5.195 Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]

0 5.621 Get:13 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2,765 kB]

0 8.501 Get:14 https://apt.llvm.org/bionic llvm-toolchain-bionic-9 InRelease [6,818 B]

0 8.600 Get:15 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,503 kB]

0 9.646 Get:16 https://apt.llvm.org/bionic llvm-toolchain-bionic-9/main amd64 Packages [8,825 B]

0 12.61 Get:17 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]

0 12.67 Get:18 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]

0 13.32 Get:19 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]

0 35.70 Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2,277 kB]

0 38.86 Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [29.8 kB]

0 39.13 Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3,199 kB]

0 41.65 Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [966 kB]

0 42.35 Get:24 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [12.9 kB]

0 42.61 Get:25 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [12.2 kB]

0 42.66 Reading package lists...

0 43.83 W: GPG error: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC

0 43.83 E: The repository 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.


failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get upgrade -y --assume-yes && apt-get install -y --assume-yes libpq-dev postgresql && rm -rf /var/lib/apt/lists/*]: exit code: 100

gustavoberman commented 2 years ago

looks like latest fpco/stack-build:latest introduce this error, previously I had a build without this problem.

halogenandtoast commented 2 years ago

Can you edit the docker file and try:

fpco/stack-build:lts-19.5

halogenandtoast commented 2 years ago

Alternatively maybe a solution from: https://forums.developer.nvidia.com/t/invalid-public-key-for-cuda-apt-repository/212901/25

gustavoberman commented 2 years ago

Alternatively maybe a solution from: https://forums.developer.nvidia.com/t/invalid-public-key-for-cuda-apt-repository/212901/25

Yep! Inserted this:

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub

In lines 30 and 59 (before the apt-get update for fpco/stack-build images)