Skip to content

Commit

Permalink
feat: Add Dockerfile for containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
wanetty committed May 18, 2024
1 parent d50111e commit 3aa2367
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM docker.io/golang:1.16-alpine AS build
WORKDIR /src
COPY go.mod ./
RUN go mod download
COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o upgopher .

FROM alpine:latest

WORKDIR /app
COPY --from=build /src/upgopher .
COPY static ./static
RUN mkdir uploads
EXPOSE 9090
CMD ["./upgopher"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ git clone https://github.com/wanetty/upgopher.git
cd upgopher
go build
```
### Docker

```bash
podman build . -t upgopher
podman run --name upgopher -p 9090:9090 upgopher
```

## Usage

Expand Down

0 comments on commit 3aa2367

Please sign in to comment.