docker: refactoring (#735)

* build: switch ubuntu image to lunar

* dcoker: support multi-platform builds

* docker: strip binary

* docker: multicore execution

* readme: change docker hub to smp-server
This commit is contained in:
sh
2023-04-24 13:10:05 +03:00
committed by GitHub
parent dc40c3461a
commit 605970f6b6
3 changed files with 8 additions and 5 deletions

View File

@@ -105,7 +105,7 @@ apt update && apt install openssl
#### Using Docker
On Linux, you can deploy smp server using Docker. This will download image from [Docker Hub](https://hub.docker.com/r/simplexchat/simplexmq).
On Linux, you can deploy smp server using Docker. This will download image from [Docker Hub](https://hub.docker.com/r/simplexchat/smp-server).
1. Create `config` and `logs` directories:
@@ -121,7 +121,7 @@ On Linux, you can deploy smp server using Docker. This will download image from
-p 5223:5223 \
-v $HOME/simplex/config:/etc/opt/simplex:z \
-v $HOME/simplex/logs:/var/opt/simplex:z \
simplexchat/simplexmq:latest
simplexchat/smp-server:latest
```
#### Ubuntu

View File

@@ -1,5 +1,5 @@
FROM ubuntu:focal AS final
FROM ubuntu:focal AS build
FROM --platform=$BUILDPLATFORM ubuntu:23.04 AS final
FROM --platform=$BUILDPLATFORM ubuntu:23.04 AS build
### Build stage
@@ -23,6 +23,9 @@ WORKDIR /project
RUN cabal update
RUN cabal install
# Strip the binary from debug symbols to reduce size
RUN strip /root/.cabal/bin/smp-server
### Final stage
FROM final

View File

@@ -24,5 +24,5 @@ fi
# Finally, run smp-sever. Notice that "exec" here is important:
# smp-server replaces our helper script, so that it can catch INT signal
exec smp-server start
exec smp-server start +RTS -N -RTS