~blu/artemis

a6fcbf8550ed1ff917d28f33408ed3a24fc62784 — Bryant Conquest 1 year, 4 months ago bb3c3bc
use custom dockerfile
4 files changed, 14 insertions(+), 6 deletions(-)

M .dockerignore
M .gitignore
M Dockerfile
M config/config.go
M .dockerignore => .dockerignore +1 -0
@@ 1,3 1,4 @@
# flyctl launch added from .gitignore
**/.env
fly.toml
artemis

M .gitignore => .gitignore +1 -0
@@ 1,2 1,3 @@
artemis
.env
artemis.toml

M Dockerfile => Dockerfile +3 -2
@@ 2,8 2,9 @@ FROM golang:alpine

WORKDIR /app
COPY . .
RUN mv artemis.toml ../artemis.toml

RUN go build -o /artemis
RUN go build

EXPOSE 8080
CMD [ "/artemis" ]
CMD [ "./artemis" ]

M config/config.go => config/config.go +9 -4
@@ 18,8 18,8 @@ type cache struct {
}

type Config struct {
	B2    *b2    `toml:"b2"`
	Cache *cache `toml:"cache"`
	B2    b2    `toml:"b2"`
	Cache cache `toml:"cache"`
}

func Load(path string) (*Config, error) {


@@ 30,8 30,13 @@ func Load(path string) (*Config, error) {
		return &config, err
	}

	config.B2.AppID = os.Getenv("ARTEMIS_APP_ID")
	config.B2.KeySecret = os.Getenv("ARTEMIS_KEY_SECRET")
	if val := os.Getenv("ARTEMIS_APP_ID"); val != "" {
		config.B2.AppID = val
	}

	if val := os.Getenv("ARTEMIS_KEY_SECRET"); val != "" {
		config.B2.KeySecret = val
	}

	if config.Cache.Pattern == "" {
		config.Cache.Pattern = "artemis-*"