Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easy docker launch server #30

Open
lastlink opened this issue Oct 23, 2024 · 2 comments
Open

easy docker launch server #30

lastlink opened this issue Oct 23, 2024 · 2 comments

Comments

@lastlink
Copy link

  • a docker image or steps to build one for running a server
@solcloud
Copy link
Owner

solcloud commented Oct 25, 2024

Something like this should work:

from project root directory

# install vendor folder
docker run --rm --volume $PWD:/app composer install -a --no-dev --ignore-platform-reqs
# build server php image with socket support
printf 'FROM php:8.3-cli\n\nRUN docker-php-ext-install sockets\n' > Dockerfile
docker build -t csf .
# run server
docker run --rm --init -it -v $PWD:/app -p 8080:8080/udp -w /app csf php cli/server.php

@dstnzrkl
Copy link

dstnzrkl commented Nov 20, 2024

Here's an example Dockerfile that should work with no extra work.

FROM composer/composer:latest

RUN apk add --no-cache linux-headers && docker-php-ext-install sockets
RUN git clone https://github.com/solcloud/Counter-Strike . && composer install -a --no-dev

EXPOSE 8080
ENTRYPOINT ["php", "cli/server.php"]
CMD ["2"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants