docker stuff

This commit is contained in:
b1ek 2024-01-07 12:30:43 +10:00
parent eca32f0507
commit d782352363
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 27 additions and 0 deletions

2
server/.dockerignore Normal file
View File

@ -0,0 +1,2 @@
Dockerfile
docker-compose.yml

15
server/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM rust:1.75-alpine3.18 as build
RUN apk add --no-cache musl-dev upx
WORKDIR /opt/build
COPY . .
RUN cargo install --path .
RUN strip /usr/local/cargo/bin/blek-online-server && upx /usr/local/cargo/bin/blek-online-server
FROM alpine:3.18
COPY --from=build /usr/local/cargo/bin/blek-online-server /usr/bin/blek-online-server
CMD [ "/usr/bin/blek-online-server" ]

10
server/docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '3.8'
services:
server:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 8000:80 # expose to "8000"