Dockerfile question

Hi! I successfully implemented TS3 on my server, manually:

mkdir /data/teamspeak

then

docker create -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -e TS3SERVER_LICENSE=accept --restart always --name Teamspeak - v /data/teamspeak/:/var/ts3server/ teamspeak

then

docker start Teamspeak

and copied the token from logs - ran perfectly.

But now I want to implement the TS via Dockerfile (unfortunately docker-compose doesn’t work here, neither does stack deploy).

Here is my Dockerfile:

#Teamspeak Docker File
FROM teamspeak:latest
VOLUME /var/ts3server/
ENV TS3SERVER_LICENSE: accept
EXPOSE 9987
EXPOSE 10011
EXPOSE 30033

The server sets environment variables itself, it also takes care of the mapping, but the docker file doesn’t work that way - do you notice something obvious that I still have to squeeze into the file (besides environment variables or mapping?)?

I don’t understand what you want to accomplish with this. If you create your own Dockerfile you will have to run a docker create and docker start command as well, so there is no difference. If you want to deploy it alongside other Services you will have to use docker-compose

Hello Lukas, I just want to try the whole thing with a Dockerfile - since the admin panel does a lot itself, it’s not that simple. But thanks for the hint, I’ll try create and start! Thanks and I’ll get back to you if it worked :slight_smile:

Dockerfiles are used to create Docker images. You can not use a Dockerfile to tell docker what ports to expose / redirect, what to mount, etc.
All those definitions are used mostly as placeholders for what the the image author would like to happen with the image.

But you also do not necessarily need compose or stacks. You can just run an image manually in a container. But still a Dockerfile is not how that works.

If the admin panel you use does not allow for your own stacks (e.g. compose files) then there needs to be a way to simply run an image with the desired settings.

TL;DR A Dockerfile is not how used to run an image but create one. There needs to be another place in your admin panel where you can run an existing image.