mirror of
https://github.com/originalmk/archat-server.git
synced 2025-01-18 16:29:17 +00:00
Add Dockerfile
This commit is contained in:
parent
84193ed322
commit
05a4063ef3
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM golang:1.22 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download && go mod verify
|
||||||
|
COPY *.go .
|
||||||
|
COPY common/ common/
|
||||||
|
COPY client/ client/
|
||||||
|
COPY server/ server/
|
||||||
|
RUN go build -v -o ./archat-server .
|
||||||
|
|
||||||
|
FROM ubuntu:noble
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/archat-server /app/archat-server
|
||||||
|
CMD ["./archat-server", "--run", "server"]
|
15
README.md
15
README.md
@ -23,3 +23,18 @@ go run . --run server --waddr krzyzanowski.dev:8080 --uaddr krzyzanowski.dev:808
|
|||||||
`--waddr` and `--uaddr` options are optional, default values are respectively `:8080` and `:8081` (which is a short form of `localhost:8080` and `localhost:8081`)
|
`--waddr` and `--uaddr` options are optional, default values are respectively `:8080` and `:8081` (which is a short form of `localhost:8080` and `localhost:8081`)
|
||||||
|
|
||||||
`--run` option is mandatory and may take value of either `client` or `server`
|
`--run` option is mandatory and may take value of either `client` or `server`
|
||||||
|
|
||||||
|
## Running using Docker
|
||||||
|
You are provided with Dockerfile inside this repository. You can use it to build your image and run archat-server
|
||||||
|
in a container. This image does not allow to run client, because it does not make sense.
|
||||||
|
|
||||||
|
0. Enter the top directory of this repository (using cd)
|
||||||
|
1. Start with building image
|
||||||
|
```bash
|
||||||
|
docker build -t archat-server .
|
||||||
|
```
|
||||||
|
2. Now run a container
|
||||||
|
```bash
|
||||||
|
docker run -d -p 8080-8081:8080-8081 archat-server
|
||||||
|
```
|
||||||
|
You may change exposed ports according to your needs, just remember that they need to be open. Also, be sure to build an image after any code update :)
|
Loading…
x
Reference in New Issue
Block a user