add docker stuff

This commit is contained in:
b1ek 2024-04-21 15:17:31 +10:00
parent 87d3150a50
commit 7aa4b8997c
Signed by: blek
GPG Key ID: 14546221E3595D0C
4 changed files with 19 additions and 1 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
/target
Dockerfile
docker-compose.yml

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
docker-compose.yml

View File

@ -3,11 +3,13 @@ FROM rust:alpine3.19 as builder
WORKDIR /opt/build
COPY . .
RUN apk add --no-cache musl-dev
RUN cargo b -r
FROM alpine:3.19
LABEL maintainer='blek! <me@blek.codes>'
COPY . /usr/share/invite-maker-src
COPY --from=builder /opt/build/target/invite-maker /usr/bin/invite-maker
COPY --from=builder /opt/build/target/release/invite-maker /usr/bin/invite-maker
CMD [ "/usr/bin/invite-maker" ]

View File

@ -0,0 +1,12 @@
# modify this file to suit your server configuration
services:
server:
build:
target: .
dockerfile: Dockerfile
restart: always
ports:
- 8080:8080
environment:
LISTEN: 0.0.0.0:8080