Skip to content

Commit de39dd0

Browse files
committed
Add submodule init for docker, add template env fallback
Submodules aren't initialized in new clones of the repo, so they need to be initialized when building the docker container. Also added a template environment file for docker-compose to load, since the default ".env" file won't exist in new clones of the repo. See #5
1 parent 50a549d commit de39dd0

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.git
21
.github
32
*.env
43
cli

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ session*
99
!session.go
1010
!backend/server/session
1111
*.env*
12+
!template.env
1213
!.tests.env
1314
*.swp
1415
tags

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ FROM alpine:latest AS builder
44

55
WORKDIR /app
66

7-
RUN apk add --update go npm make
7+
RUN apk add --update go npm make git
88
RUN npm install -g typescript
99

1010
COPY go.mod go.sum ./
1111
RUN go mod download
1212

13+
COPY .git/ ./.git
1314
COPY backend/ ./backend
1415
COPY utils/ ./utils
1516
COPY web/ ./web
@@ -18,6 +19,7 @@ COPY tsconfig.json .
1819

1920
COPY Makefile .
2021

22+
RUN git submodule update --init --recursive
2123
RUN make backend
2224

2325
# Server image

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
depends_on:
3030
db:
3131
condition: service_healthy
32-
env_file: "${YEETFILE_ENV_FILE:-.env}"
32+
env_file: "${YEETFILE_ENV_FILE:-template.env}"
3333
environment:
3434
YEETFILE_DB_HOST: "db"
3535

template.env

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
YEETFILE_DB_USER="postgres"
2+
YEETFILE_DB_PASS="postgres"
3+
YEETFILE_DB_NAME="yeetfile"
4+
YEETFILE_DB_HOST="localhost"
5+
6+
# These should be set with different base64 secret values. You can
7+
# generate with something like:
8+
# openssl rand -base64 32
9+
#YEETFILE_SERVER_SECRET=""
10+
#YEETFILE_SESSION_AUTH_KEY=""
11+
#YEETFILE_SESSION_ENC_KEY=""
12+
13+
# Unlimited storage and send
14+
YEETFILE_DEFAULT_USER_STORAGE=-1
15+
YEETFILE_DEFAULT_USER_SEND=-1
16+
17+
# Limited storage and send
18+
#YEETFILE_DEFAULT_USER_STORAGE=15000000 # 15MB
19+
#YEETFILE_DEFAULT_USER_SEND=5000000 # 5 MB
20+
21+
# To enable Backblaze B2 storage:
22+
#YEETFILE_STORAGE=b2
23+
#YEETFILE_B2_BUCKET_ID="" # Set this to the bucket ID
24+
#YEETFILE_B2_BUCKET_KEY_ID="" # Set this to the ID of the key generated for uploading
25+
#YEETFILE_B2_BUCKET_KEY="" # Set this to the value of the key generated for uploading
26+

0 commit comments

Comments
 (0)