Skip to content

Commit 4f12bcf

Browse files
committed
inject .env at runtime using Docker volume
1 parent b2d4d7e commit 4f12bcf

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

.dockerignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ rustCode/target
1111
**/*.exe
1212

1313
# Env & secrets
14-
#.env
15-
#**/.env
14+
.env
15+
**/.env
1616
#!goCode/.env
1717

1818
# Docker

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ WORKDIR /app/goCode/goApp
1818
ENV CGO_ENABLED=1
1919
RUN go build -o app
2020

21-
2221
# ----------------------------
2322
FROM ubuntu:24.04
2423
WORKDIR /app/goCode/goApp
@@ -36,8 +35,6 @@ COPY --from=go-builder \
3635
/app/goCode/libs/librpc.so \
3736
../libs/librpc.so
3837

39-
COPY goCode/.env ../.env
40-
4138
ENV LD_LIBRARY_PATH=/app/goCode/libs
4239

4340
CMD ["./app"]

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
image: blockchain-ffi
7+
container_name: blockchain-ffi
8+
volumes:
9+
- ./goCode/.env:/app/goCode/.env
10+
# restart: unless-stopped

0 commit comments

Comments
 (0)