use a local directory instead of a named volume
This makes the settings.json more accessible from the outside by default, but is less portable. The -v command with $PWD might not work on native Windows shells, but rather wants an absolute Windows path like C:\User\... or /c/User/... And on Linux, because the /data/ directory and the settings.json will be owned by root. Though that can be changed.
This commit is contained in:
parent
c33453f902
commit
9e7e30a1ed
|
@ -18,8 +18,6 @@ FROM mcr.microsoft.com/dotnet/runtime:6.0 as runtime
|
||||||
|
|
||||||
WORKDIR /data/
|
WORKDIR /data/
|
||||||
|
|
||||||
RUN touch /data/settings.json
|
|
||||||
|
|
||||||
COPY --from=build /app/out/ /app/
|
COPY --from=build /app/out/ /app/
|
||||||
|
|
||||||
ENTRYPOINT [ "dotnet", "/app/Server.dll" ]
|
ENTRYPOINT [ "dotnet", "/app/Server.dll" ]
|
||||||
|
|
|
@ -37,7 +37,8 @@ If you have [docker](https://docs.docker.com/) on your system, you can use the e
|
||||||
That way you don't have to build this server yourself or manually handle executables.
|
That way you don't have to build this server yourself or manually handle executables.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run --rm -it -p 1027:1027 -v smoo-data:/data/ ghcr.io/sanae6/smo-online-server
|
docker run --rm -it -p 1027:1027 -v "/$PWD/data/://data/" ghcr.io/sanae6/smo-online-server
|
||||||
|
# on Windows, depending on the shell you're using, $PWD might not work. Use an absolute path instead.
|
||||||
```
|
```
|
||||||
|
|
||||||
To always check for and use the latest server version you can add `--pull=always` to the options.
|
To always check for and use the latest server version you can add `--pull=always` to the options.
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
volumes:
|
|
||||||
smoo-data:
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: ghcr.io/sanae6/smo-online-server
|
image: ghcr.io/sanae6/smo-online-server
|
||||||
|
#build: .
|
||||||
|
#user: 1000:1000
|
||||||
ports:
|
ports:
|
||||||
- 1027:1027
|
- 1027:1027
|
||||||
volumes:
|
volumes:
|
||||||
- smoo-data:/data/
|
- ./data/:/data/
|
||||||
|
|
Loading…
Reference in New Issue