Skip to content

Instantly share code, notes, and snippets.

@OnniSaarni
Last active August 20, 2024 01:15
Show Gist options
  • Save OnniSaarni/a3f840cef63335212ae085a3c6c10d5c to your computer and use it in GitHub Desktop.
Save OnniSaarni/a3f840cef63335212ae085a3c6c10d5c to your computer and use it in GitHub Desktop.
SPT MPT/Fika Server With Docker Ubuntu/Debian/Raspberry Pi
@HectorLeeYE
Copy link

Sorry for those who helped answer my Raspberry PI questions but I couldn't use a raspberry pi in the end as I couldn't find a coupon to get a discount on a raspberry pi from a shop in my country (Singapore) 😅

With that said, for anyone who is googling this, I can confirm that this works on a Linux VPS. That said, as I've stated (and checked by others), this server is a HTTP server. It's not that lightweight (meaning that the cheapest VPS will not allow you to get away), but the second VPS should be fine.

I've kindly attached an image to show how much RAM you generally need (You do this by running free -h in terminal. Note: If you're using a windows VPS, you might need to RDP inside as I am very sure that this command does not work inside windows cmd
** I am running a few server side mods (AI Spawning, bot brains)
NeedRamGithub

Perhaps @OnniSaarni could add a small section to your github docker repo page detailing that you'll need 1GB Minimum, and that this isn't really recommended because there could be a spike? I'll edit this comment again if there are any issues with spikes since I honestly have not tested system scalability stats according to number of players connecting

@OnniSaarni
Copy link
Author

@HectorLeeYE I would consider it pretty lightweight if it only uses 1gb of ram. Other game servers use a lot more resources. I'll probably add some minimum system requirements on the page soon. Thanks for the suggestion.

@ChrisyG6
Copy link

ChrisyG6 commented Aug 13, 2024

Anyone had an issue whereby Traders aren't selling the same amount of items VS Windows SPT Server?
I've just installed SPT 3.9.5 / FIKA 2.2.7 on Linux and compared it against the SPT Server.exe on my Windows machine and noticed that Ref at lvl 1 trader level has no items for sale on Linux, But on Windows he has about 20 items or so.

Same with Mechanic, He is missing alot of items at level 1. Mainly guns and Items, like the Toolkit.

I've compared Mechanic's trader files, they all match between Windows & Linux "SPT_Data\Server\database\traders\5a7c2eca46aef81a7ca2145d*"

Anyone else noticed this? IO dont have any mods installed. Just followed the Docker install guide found here and compared it to a newly installed SPT on Windows.

@OnniSaarni
Copy link
Author

@ChrisyG6 the docker setup shouldn't affect stuff like this. It could be because of Fika. The docker setup automatically installs the serverside Fika mod.

@ChrisyG6
Copy link

Thanks Onni, Oddly enough I have just redeployed again and this time the traders are showing items correctly. I will see if I can re-create the problem and report back if I find out what it is. Thanks for the quick reply :)

@ChrisyG6
Copy link

ChrisyG6 commented Aug 13, 2024

It was my fault.. It was SVM Mod, I had "RemoveBarterOffers" set to true. Which is odd, as it wasn't in the mods folder when after I installed.

@OnniSaarni
Copy link
Author

@ChrisyG6 Alright! Good to know there was no real issue.

@awiltjr
Copy link

awiltjr commented Aug 20, 2024

Brand new Debian 12 install, seems like the documented Fika build needs updating:

=====

sudo docker build --no-cache --label FIKA -t fika .

=====

[+] Building 74.1s (15/32)                                       docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.95kB                                     0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest           0.2s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => CACHED [builder  1/22] FROM docker.io/library/ubuntu:latest@sha256:8a  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 29B                                           0.0s
 => CACHED [stage-1 2/7] WORKDIR /opt/                                     0.0s
 => [stage-1 3/7] RUN apt update && apt upgrade -yq && apt install -yq d  11.4s
 => [builder  2/22] RUN echo 'debconf debconf/frontend select Noninteract  0.5s
 => [builder  3/22] WORKDIR /opt                                           0.0s
 => [builder  4/22] RUN apt update && apt install -yq git git-lfs curl    19.8s
 => [builder  5/22] RUN git clone https://github.com/nvm-sh/nvm.git $HOME  1.3s
 => [builder  6/22] RUN . $HOME/.nvm/nvm.sh && nvm install 20.11.1         4.8s
 => [builder  7/22] RUN git clone https://dev.sp-tarkov.com/SPT/Server.g  47.0s
 => [builder  8/22] WORKDIR /opt/srv/project                               0.0s
 => ERROR [builder  9/22] RUN git checkout tags/[Insert                    0.3s
------
 > [builder  9/22] RUN git checkout tags/[Insert:
0.240 error: pathspec 'tags/[Insert' did not match any file(s) known to git
------

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 65)
Dockerfile:27
--------------------
  25 |     WORKDIR /opt/srv/project
  26 |
  27 | >>> RUN git checkout tags/$SPT_TAG
  28 |     RUN git checkout $SPT
  29 |     RUN git-lfs pull
--------------------
ERROR: failed to solve: process "/bin/sh -c git checkout tags/$SPT_TAG" did not complete successfully: exit code: 1

Can this part just be updated:

=====

FROM ubuntu:latest AS builder
ARG FIKA=HEAD^
ARG FIKA_TAG=[Insert Tag Here]
ARG SPT=HEAD^
ARG SPT_TAG=[Insert Tag Here]
ARG NODE=20.11.1

=====

to:

=====

FROM ubuntu:latest AS builder
ARG FIKA=HEAD
ARG FIKA_TAG=v2.2.8
ARG SPT=HEAD
ARG SPT_TAG=3.9.5
ARG NODE=20.11.1

=====

But even after doing so errors persist:

=====

[```
+] Building 200.6s (29/32)                                      docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.92kB                                     0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest           0.2s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 29B                                           0.0s
 => CACHED [builder  1/22] FROM docker.io/library/ubuntu:latest@sha256:8a  0.0s
 => CACHED [stage-1 2/7] WORKDIR /opt/                                     0.0s
 => [stage-1 3/7] RUN apt update && apt upgrade -yq && apt install -yq d  13.6s
 => [builder  2/22] RUN echo 'debconf debconf/frontend select Noninteract  0.5s
 => [builder  3/22] WORKDIR /opt                                           0.0s
 => [builder  4/22] RUN apt update && apt install -yq git git-lfs curl    18.8s
 => [builder  5/22] RUN git clone https://github.com/nvm-sh/nvm.git $HOME  1.4s
 => [builder  6/22] RUN . $HOME/.nvm/nvm.sh && nvm install 20.11.1         4.3s
 => [builder  7/22] RUN git clone https://dev.sp-tarkov.com/SPT/Server.g  43.8s
 => [builder  8/22] WORKDIR /opt/srv/project                               0.0s
 => [builder  9/22] RUN git checkout tags/3.9.5                            1.3s
 => [builder 10/22] RUN git checkout HEAD                                  0.5s
 => [builder 11/22] RUN git-lfs pull                                       0.7s
 => [builder 12/22] RUN sed -i '/setEncoding/d' /opt/srv/project/src/Prog  0.3s
 => [builder 13/22] RUN . $HOME/.nvm/nvm.sh && npm install && npm run b  102.9s
 => [builder 14/22] RUN mv build/ /opt/server/                             7.0s
 => [builder 15/22] WORKDIR /opt                                           0.0s
 => [builder 16/22] RUN rm -rf srv/                                        7.0s
 => [builder 17/22] RUN git clone https://github.com/project-fika/Fika-Se  1.3s
 => [builder 18/22] WORKDIR ./server/user/mods/fika-server                 0.1s
 => [builder 19/22] RUN git checkout tags/v2.2.8                           0.4s
 => [builder 20/22] RUN git checkout HEAD                                  0.5s
 => [builder 21/22] RUN . $HOME/.nvm/nvm.sh && npm install                 6.1s
 => [builder 22/22] RUN rm -rf ../FIKA/.git                                0.3s
 => ERROR [stage-1 4/7] COPY --from=builder /opt/server /opt/srv           1.0s
------
 > [stage-1 4/7] COPY --from=builder /opt/server /opt/srv:
------

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 65)
Dockerfile:51
--------------------
  49 |     WORKDIR /opt/
  50 |     RUN apt update && apt upgrade -yq && apt install -yq dos2unix
  51 | >>> COPY --from=builder /opt/server /opt/srv
  52 |     COPY fcpy.sh /opt/fcpy.sh
  53 |     # Fix for Windows
--------------------
ERROR: failed to solve: failed to copy files: copy file range failed: no space left on device

=====

@ChrisyG6
Copy link

Shouldn't "ARG SPT_TAG=3.9.5" not be the latest SPT version? 3.9.8?

https://hub.sp-tarkov.com/files/file/16-spt/

@HectorLeeYE
Copy link

ERROR: failed to solve: process "/bin/sh -c git checkout tags/$SPT_TAG" did not complete successfully: exit code: 1

States that your error is due to a wrong tag, which you identified since $SPT_TAG is just a placeholder; replace it with your desired tag.

ERROR: failed to solve: failed to copy files: copy file range failed: no space left on device

States that you have no disk space left, so prune your docker to reclaim more disk space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment