Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --- Build ---
FROM gcc:latest AS builder

WORKDIR /app

COPY ./rwslotmachine5.c .

RUN gcc -o rwslotmachine5 rwslotmachine5.c

# --- Runtime ---
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y libstdc++6 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /app/rwslotmachine5 .

EXPOSE 31348

CMD ["/app/rwslotmachine5"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PORT ?= 31348
IMG_NAME ?= rwslotmachine5
CONT_NAME ?= $(IMG_NAME)-cnt

build:
docker build -t $(IMG_NAME) -f Dockerfile .

run: build
docker run -d -p $(PORT):31348 --name $(CONT_NAME) -t $(IMG_NAME)

stop:
-docker stop $(CONT_NAME)

clean: stop
docker rm $(CONT_NAME)

.PHONY: build run stop clean