-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): add Dockerfile and docker-compose.yml to quickstart the…
… app.
- Loading branch information
1 parent
bfc8eae
commit 28201e6
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Build the UI | ||
FROM node:18.17.0-bullseye-slim AS nodework | ||
WORKDIR /app | ||
COPY ui/ . | ||
RUN npm install | ||
RUN npm run build | ||
|
||
# Build the Go binary | ||
FROM golang:1.22 AS gowork | ||
WORKDIR /app | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN go build -o /app/main . | ||
|
||
|
||
# Run the binary in a alpine container | ||
FROM ubuntu:22.04 | ||
WORKDIR /app | ||
COPY --from=gowork /app/main . | ||
CMD [ "./main" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
services: | ||
server: | ||
image: go-fast-cdn | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- uploads:/app/uploads | ||
- db_data:/app/db_data | ||
container_name: go-fast-cdn | ||
volumes: | ||
db_data: | ||
uploads: |