Dockerfiles out of date with new folder structure?

(#238) Bug Fixed self-hosting

Summary

Trying to push to production using docker, fails on so many places, dockerfiles need a refresh. The reason why I needed to build the dockerfile myself is that the ghcr.io doesnt have the images.

Steps to reproduce

  1. Clone the repo
  2. docker build -t fluxer_server:stable fluxer_server/.

Environment (optional)

  • Refactor
  • NixOS
  • Docker

25 comments

Sign in with Fluxer to comment and vote.
Off-topic comment by @Mar0xy
RexSystem 1 vote originally by @Mar0xy on GitHub Collapsed as outdated by Rex: Speculation from before official self-hosting support.
Pretty sure this is to be expected considering the refactor is still WIP and there are also no complete self-hosting docs. The docker images will probably come into existence once the refactor is actually stable and complete, the same applies to the dockerfiles being all out of place currently or not having the correct paths
Comment by @electron271
RexSystem 1 vote originally by @electron271 on GitHub
i managed to get it working by editing some of the files, heres the patch id still recommend waiting for the official self hosting info though for anything more than experimentation, this patch was also pretty rushed patch start with docker compose up -d --build you will need a config/config.json file, heres mine with some parts redacted (some things may be broken, im still trying to work on fixing everything)
{
	"$schema": "../packages/config/src/ConfigSchema.json",
	"env": "production",
	"domain": {
		"base_domain": "fluxer.electron271.gay",
		"public_port": 443,
		"public_scheme": "https",
		"static_cdn_domain": "fluxer.electron271.gay"
	},
	"database": {
		"backend": "sqlite"
	},
	"internal": {
		"kv": "redis://valkey:6379/0"
	},
	"instance": {
		"auto_join_invite_code": ""
	},
	"s3": {
		"access_key_id": "YOUR_S3_ACCESS_KEY",
		"secret_access_key": "YOUR_S3_SECRET_KEY",
		"endpoint": "http://127.0.0.1:8080/s3"
	},
	"services": {
		"server": {
			"port": 8080,
			"host": "0.0.0.0",
			"static_dir": "../assets"
		},
		"media_proxy": {
			"secret_key": "GENERATE_A_64_CHAR_HEX_SECRET"
		},
		"admin": {
			"secret_key_base": "GENERATE_A_64_CHAR_HEX_SECRET",
			"oauth_client_secret": "GENERATE_A_64_CHAR_HEX_SECRET"
		},
		"marketing": {
			"enabled": true,
			"secret_key_base": "GENERATE_A_64_CHAR_HEX_SECRET"
		},
		"gateway": {
			"port": 8082,
			"admin_reload_secret": "GENERATE_A_64_CHAR_HEX_SECRET",
			"media_proxy_endpoint": "http://127.0.0.1:8080/media"
		},
		"nats": {
			"core_url": "nats://nats:4222",
			"jetstream_url": "nats://nats:4222",
			"auth_token": ""
		}
	},
	"auth": {
		"sudo_mode_secret": "GENERATE_A_64_CHAR_HEX_SECRET",
		"connection_initiation_secret": "GENERATE_A_64_CHAR_HEX_SECRET",
		"vapid": {
			"public_key": "YOUR_VAPID_PUBLIC_KEY",
			"private_key": "YOUR_VAPID_PRIVATE_KEY"
		},
		"passkeys": {
			"additional_allowed_origins": ["https://fluxer.electron271.gay"]
		},
		"bluesky": {
			"enabled": false,
			"client_name": "Fluxer",
			"client_uri": "",
			"logo_uri": "https://fluxerstatic.com/web/apple-touch-icon.png",
			"tos_uri": "https://fluxer.app/terms",
			"policy_uri": "https://fluxer.app/privacy",
			"keys": []
		}
	},
	"integrations": {
		"search": {
			"url": "http://meilisearch:7700",
			"api_key": "API_KEY"
		}
	},
	"federation": {
		"enabled": false
	}
}
Comment by @Katacc
RexSystem 1 vote edited originally by @Katacc on GitHub OP
Amazing work, im trying it out rn! Keep me posted on updates with this! @electron271
Comment by @electron271
RexSystem 1 vote edited originally by @electron271 on GitHub
Amazing work, im trying it out rn! Keep me posted on updates with this! @electron271
glad to hear! right now im working on trying to get the media proxy to work with nginx (duplicate content-length headers are messing with it), ill send another patch/more info once thats done
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
patch this should be fixed, also fixed some csp errors
Awesome! Do you have nginx in front of it or does the caddy handle ssl certs with this setup?
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
Hmm, I got this error with the new patch
------
 > [app-build 11/11] RUN pnpm rspack build --mode production && pnpm tsx scripts/build-sw.mjs:
0.996 node:fs:439
0.996     return binding.readFileUtf8(path, stringToFlags(options.flag));
0.996                    ^
0.996 
0.996 Error: ENOENT: no such file or directory, open '/usr/src/app/config/config.json'
0.996     at Object.readFileSync (node:fs:439:20)
0.996     at readConfig (file:///usr/src/app/fluxer_app/rspack.config.mjs:65:21)
0.996     at default (file:///usr/src/app/fluxer_app/rspack.config.mjs:226:17)
0.996     at RspackCLI.loadConfig (/usr/src/app/node_modules/.pnpm/@rspack+cli@1.7.5_@rspack+core@1.7.5_@swc+helpers@0.5.18__@types+express@4.17.25_tslib@2.8.1/node_modules/@rspack/cli/dist/index.js:1325:38)
0.996     at async RspackCLI.buildCompilerConfig (/usr/src/app/node_modules/.pnpm/@rspack+cli@1.7.5_@rspack+core@1.7.5_@swc+helpers@0.5.18__@types+express@4.17.25_tslib@2.8.1/node_modules/@rspack/cli/dist/index.js:1205:39)
0.996     at async runBuild (/usr/src/app/node_modules/.pnpm/@rspack+cli@1.7.5_@rspack+core@1.7.5_@swc+helpers@0.5.18__@types+express@4.17.25_tslib@2.8.1/node_modules/@rspack/cli/dist/index.js:847:28)
0.996     at async CAC.<anonymous> (/usr/src/app/node_modules/.pnpm/@rspack+cli@1.7.5_@rspack+core@1.7.5_@swc+helpers@0.5.18__@types+express@4.17.25_tslib@2.8.1/node_modules/@rspack/cli/dist/index.js:862:17) {
0.996   errno: -2,
0.996   code: 'ENOENT',
0.996   syscall: 'open',
0.996   path: '/usr/src/app/config/config.json'
0.996 }
0.996 
0.996 Node.js v24.13.1
------
[+] up 0/1
 ⠙ Image ghcr.io/fluxerapp/fluxer-server:stable Building                                                                                                           2.7s
Dockerfile:144

--------------------

 142 |     ENV FLUXER_CONFIG="/usr/src/app/config/config.json"

 143 |     #RUN pnpm build

 144 | >>> RUN pnpm rspack build --mode production && pnpm tsx scripts/build-sw.mjs

 145 |     

 146 |     FROM deps AS admin-build

--------------------

failed to solve: process "/bin/sh -c pnpm rspack build --mode production && pnpm tsx scripts/build-sw.mjs" did not complete successfully: exit code: 1
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
you need to define a config.json beforehand
Weird. I have the config.json in the config/ folder. I copied your example and used my own adresses and such there
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
Nevermind, nothing a good old docker down docker up doesnt fix!
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
Got everything to work normally, but voicechat, did you manage to make that work?
Comment by @electron271
RexSystem 1 vote originally by @electron271 on GitHub
i havent tested voice chat yet and probably wont until self hosting is officially out
Comment by @000yesnt
RexSystem 1 vote originally by @000yesnt on GitHub
Got everything to work normally, but voicechat, did you manage to make that work?
I got voice to work. You'll need a separate (sub)domain for the LiveKit container. I'm also using the admin dashboard as it's easier to configure regions and servers
  • Copy config/livekit.example.yaml to config/livekit.yaml and edit it. Generate an API key and secret and put it in that config as shown in the example file.
  • Enable the voice integration in config/config.json
    	"integrations": {
    		"search": {
    			"url": "http://meilisearch:7700",
    			"api_key": "API_KEY"
    		},
    +       "voice": {
    +           "enabled": true
    +       }
    	},
  • Restart Fluxer and start the LiveKit container. Fluxer uses profiles for starting specific features separately: docker compose restart fluxer_server && docker compose --profile voice up -d
  • Configure your reverse proxy. The LiveKit container is on port 7880. Put it on a subdomain, like livekit.example.com
  • These next few steps will probably show internal server errors, but refreshing the page or going back to the dashboard shows the changes were successful. In the dashboard, under Platform > Voice Regions (/admin/voice-regions), create a new region
  • Under the new region you created, click "Manage Servers". Fill out the Add Voice Server form:
    • Endpoint: wss://livekit.example.com
    • API key and API secret: the key and secret you generated earlier
Add it, and it hopefully should just work. Voice seems to be WIP (hmm I wonder why??) but quite functional
Comment by @FiveKnives
RexSystem 1 vote originally by @FiveKnives on GitHub
Copy config/livekit.example.yaml to config/livekit.yaml and edit it. Generate an API key and secret and put it in that config as shown in the example file.
If you use the livekit docker you also have to adjust the livekit.yaml to only use a smaller port range like in the compose:
rtc:
  tcp_port: 7881

  # Restrict WebRTC UDP to exactly the published range
  port_range_start: 50000
  port_range_end: 50100
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error!
Comment by @Shadowalker125
RexSystem 1 vote originally by @Shadowalker125 on GitHub
Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error!
Question, is the selfhosted instance an entire instance of fluxer, with being able to create communites. Or is it one community you can just join and use the same client as other communities?
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
> Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error! Question, is the selfhosted instance an entire instance of fluxer, with being able to create communites. Or is it one community you can just join and use the same client as other communities?
Its a completely separated own instance of the whole fluxer
Comment by @Shadowalker125
RexSystem 1 vote originally by @Shadowalker125 on GitHub
> > Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error! > > > Question, is the selfhosted instance an entire instance of fluxer, with being able to create communites. Or is it one community you can just join and use the same client as other communities? Its a completely separated own instance of the whole fluxer
Basically what Im asking is, If I download the appimage for linux from the main site, can that connect to a self host, or Do I have to use the web app I host?
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
> > > Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error! > > > > > > Question, is the selfhosted instance an entire instance of fluxer, with being able to create communites. Or is it one community you can just join and use the same client as other communities? > > > Its a completely separated own instance of the whole fluxer Basically what Im asking is, If I download the appimage for linux from the main site, can that connect to a self host, or Do I have to use the web app I host?
Currently you have to use the webapp, though they did say that the desktop application will support selfhosted deployments
Comment by @000yesnt
RexSystem 1 vote edited originally by @000yesnt on GitHub
> > > Thanks all! Managed to spin up a server for my community with sleepless night and a lot of trial and error! > > > > > > Question, is the selfhosted instance an entire instance of fluxer, with being able to create communites. Or is it one community you can just join and use the same client as other communities? > > > Its a completely separated own instance of the whole fluxer Basically what Im asking is, If I download the appimage for linux from the main site, can that connect to a self host, or Do I have to use the web app I host?
you can also use the desktop app if you build it yourself by cloning the repo https://feedback.fluxer.com/p/3/c/40 to make your build use your instance, check the readme https://github.com/fluxerapp/fluxer/tree/refactor/fluxer_desktop patching the app.asar of the official build also works but afaik it doesn't have some important fixes to screensharing
Comment by @aneillans
RexSystem 1 vote originally by @aneillans on GitHub
How are you getting around the path issues in the dockerfile (looking at the patches posted in thread, looks like they arent updated), and presuming dockerfile not relocated? i.e. [2/7] STEP 5/57: COPY patches/ ./patches/ Error: building at STEP "COPY patches/ ./patches/": checking on sources under "/mnt/d/git/fluxer/fluxer_server": copier: stat: "/patches": no such file or directory
Comment by @Katacc
RexSystem 1 vote originally by @Katacc on GitHub OP
How are you getting around the path issues in the dockerfile (looking at the patches posted in thread, looks like they arent updated), and presuming dockerfile not relocated? i.e. [2/7] STEP 5/57: COPY patches/ ./patches/ Error: building at STEP "COPY patches/ ./patches/": checking on sources under "/mnt/d/git/fluxer/fluxer_server": copier: stat: "/patches": no such file or directory
After the patches it just works with docker compose up -d --build
Comment by @evoandroidevo
RexSystem 1 vote edited originally by @evoandroidevo on GitHub
How are you getting around the path issues in the dockerfile (looking at the patches posted in thread, looks like they arent updated), and presuming dockerfile not relocated? i.e. [2/7] STEP 5/57: COPY patches/ ./patches/ Error: building at STEP "COPY patches/ ./patches/": checking on sources under "/mnt/d/git/fluxer/fluxer_server": copier: stat: "/patches": no such file or directory
After the patches i move the dockerfile to the root of the repo and build the container with docker build -t fluxer . then do with the container what i want Also discussion #1037 has additional info and so does issue #327