This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fdfa13
commit 5507ca3
Showing
8 changed files
with
66 additions
and
107 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
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 |
---|---|---|
@@ -1,28 +1,24 @@ | ||
# Source: https://blog.golang.org/docker | ||
|
||
# Start from a Debian image with the latest version of Go installed | ||
# and a workspace (GOPATH) configured at /go. | ||
FROM golang:1.11-alpine AS build | ||
FROM golang:1.12-alpine AS build | ||
|
||
RUN apk add --no-cache build-base curl git | ||
|
||
# Copy the local package files to the container's workspace. | ||
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/ | ||
ADD ./Makefile /go/src/github.com/boramalper/magnetico/ | ||
ADD ./pkg /go/src/github.com/boramalper/magnetico/pkg | ||
ADD ./cmd/magneticod /go/src/github.com/boramalper/magnetico/cmd/magneticod | ||
ADD ./Makefile /magnetico/ | ||
ADD ./pkg /magnetico/pkg | ||
ADD ./go.mod /magnetico/go.mod | ||
ADD ./cmd/magneticod /magnetico/cmd/magneticod | ||
|
||
# Build the outyet command inside the container. | ||
# (You may fetch or manage dependencies here, | ||
# either manually or with a tool like "godep".) | ||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
WORKDIR /go/src/github.com/boramalper/magnetico/ | ||
RUN make ensure | ||
WORKDIR /magnetico/ | ||
RUN make magneticod | ||
|
||
FROM alpine:latest | ||
LABEL maintainer="[email protected]" | ||
WORKDIR / | ||
COPY --from=build /go/bin/magneticod /magneticod | ||
|
||
# Run the outyet command by default when the container starts. | ||
RUN adduser -D -S magnetico | ||
USER magnetico | ||
|
||
ENTRYPOINT ["/magneticod"] |
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 |
---|---|---|
@@ -1,30 +1,34 @@ | ||
# Source: https://blog.golang.org/docker | ||
|
||
# Start from a Debian image with the latest version of Go installed | ||
# and a workspace (GOPATH) configured at /go. | ||
FROM golang:1.11-alpine AS build | ||
FROM golang:1.12-alpine AS build | ||
|
||
RUN export PATH=$PATH:/go/bin | ||
|
||
RUN apk add --no-cache build-base curl git | ||
|
||
# Copy the local package files to the container's workspace. | ||
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/ | ||
ADD ./Makefile /go/src/github.com/boramalper/magnetico/ | ||
ADD ./pkg /go/src/github.com/boramalper/magnetico/pkg | ||
ADD ./cmd/magneticow /go/src/github.com/boramalper/magnetico/cmd/magneticow | ||
|
||
# Build the outyet command inside the container. | ||
# (You may fetch or manage dependencies here, | ||
# either manually or with a tool like "godep".) | ||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
WORKDIR /go/src/github.com/boramalper/magnetico/ | ||
RUN make ensure | ||
ADD ./Makefile /magnetico/ | ||
ADD ./pkg /magnetico/pkg | ||
ADD ./go.mod /magnetico/go.mod | ||
ADD ./cmd/magneticow /magnetico/cmd/magneticow | ||
|
||
WORKDIR /magnetico | ||
|
||
RUN go get -u github.com/kevinburke/go-bindata/... | ||
|
||
RUN echo $PATH | ||
RUN ls /go/bin | ||
|
||
RUN make magneticow | ||
|
||
FROM alpine:latest | ||
LABEL maintainer="[email protected]" | ||
WORKDIR / | ||
COPY --from=build /go/bin/magneticow /magneticow | ||
|
||
# Run the outyet command by default when the container starts. | ||
RUN adduser -D -S magnetico | ||
USER magnetico | ||
|
||
ENTRYPOINT ["/magneticow"] | ||
|
||
# Document that the service listens on port 8080. | ||
|
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
version: "2" | ||
version: "3" | ||
|
||
volumes: | ||
shared_db: | ||
home: | ||
|
||
services: | ||
magneticod: | ||
build: | ||
context: magneticod | ||
context: . | ||
dockerfile: Dockerfile.magneticod | ||
volumes: | ||
- shared_db:/root/.local/share | ||
- home:/home/magnetico | ||
|
||
magneticow: | ||
build: | ||
context: magneticow | ||
context: . | ||
dockerfile: Dockerfile.magneticow | ||
volumes: | ||
- shared_db:/root/.local/share | ||
- home:/home/magnetico | ||
depends_on: | ||
# It doesn't necessarily "depend" on magneticod, but you would probably like to start them at the same time. | ||
- magneticod | ||
|
||
ports: | ||
- "12345:8080" | ||
- "8080:8080" |
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,21 @@ | ||
module github.com/boramalper/magnetico | ||
|
||
require ( | ||
github.com/Wessie/appdirs v0.0.0-20141031215813-6573e894f8e2 | ||
github.com/anacrolix/missinggo v1.1.0 | ||
github.com/anacrolix/torrent v1.1.4 | ||
github.com/dustin/go-humanize v1.0.0 | ||
github.com/gorilla/mux v1.7.2 | ||
github.com/gorilla/schema v1.1.0 | ||
github.com/jessevdk/go-flags v1.4.0 | ||
github.com/kevinburke/go-bindata v3.13.0+incompatible // indirect | ||
github.com/libp2p/go-sockaddr v0.0.1 | ||
github.com/mattn/go-sqlite3 v1.10.0 | ||
github.com/pkg/errors v0.8.1 | ||
github.com/willf/bloom v2.0.3+incompatible | ||
go.uber.org/atomic v1.4.0 // indirect | ||
go.uber.org/multierr v1.1.0 // indirect | ||
go.uber.org/zap v1.10.0 | ||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f | ||
golang.org/x/sys v0.0.0-20190516110030-61b9204099cb | ||
) |