Skip to content

Commit 70968e5

Browse files
authored
Set environment variables for config path and port
Added environment variables for configuration path and port.
1 parent f575d5f commit 70968e5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

docker/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ WORKDIR /app/
3131
COPY --from=builder /app/main .
3232
COPY ./config/config.example.json ./config.json
3333

34+
# Variables
35+
ENV CONFIG_PATH=/app/config.json
36+
ENV PORT=8080
37+
3438
# Set ownership and permissions
3539
RUN chown -R appuser:appuser /app && chmod -R 755 /app
3640

3741
# Switch to non-root user
3842
USER appuser
3943

40-
ENV PORT=8080
41-
4244
# Command to run
43-
CMD ["./main", "-config", "config.json"]
45+
CMD ["sh", "-c", "./main -config ${CONFIG_PATH}"]

0 commit comments

Comments
 (0)