Skip to content

Commit 3b06a96

Browse files
Fixed .env loading issues and docker-compose works perfectly!
1 parent f864785 commit 3b06a96

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ FROM debian:latest
1515

1616
WORKDIR /app
1717

18-
# Copy binary and config
18+
# Copy only the built binary
1919
COPY --from=builder /app/bin/laclm ./bin/laclm
20-
# COPY config.yaml .
21-
COPY .env .
2220

23-
# Install `bash` to source the env file
21+
# Install bash in case needed
2422
RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/*
2523

2624
EXPOSE 8080
2725

28-
# Use a wrapper script to load env vars and run the binary
29-
COPY docker-entrypoint.sh .
30-
31-
RUN chmod +x docker-entrypoint.sh
32-
33-
ENTRYPOINT ["./docker-entrypoint.sh"]
26+
# Default command to run your Go app
27+
CMD ["./bin/laclm", "--config", "config.yaml"]

docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ services:
99
ports:
1010
- "8080:8080"
1111
volumes:
12-
# config.yaml is mounted as volume - editable outside docker
13-
- ./config.yaml:/app/config.yaml
12+
- ./config.yaml:/app/config.yaml # mount config from host
13+
- ./.env:/app/.env # mount env file from host
1414
depends_on:
1515
- openldap
1616
- redis
@@ -35,9 +35,9 @@ services:
3535
container_name: phpldapadmin
3636
environment:
3737
PHPLDAPADMIN_LDAP_HOSTS: openldap
38-
PHPLDAPADMIN_HTTPS: "false" # disable HTTPS for local development
38+
PHPLDAPADMIN_HTTPS: "false"
3939
ports:
40-
- "8090:80" # accessible via http://localhost:8090
40+
- "8090:80"
4141
depends_on:
4242
- openldap
4343
networks:

0 commit comments

Comments
 (0)