Skip to content

Commit

Permalink
Fix: config file default use datadir/config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Oct 18, 2023
1 parent db6d5f5 commit 05fbedb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ ENV SERVER_LISTEN=0.0.0.0

ENV SERVER_PORT=8080

# only log to stdout
ENV LOG_ENABLE=false

COPY --from=builder /synctv/build/synctv /usr/local/bin/synctv

COPY entrypoint.sh /entrypoint.sh
Expand All @@ -31,6 +28,10 @@ RUN chmod +x /entrypoint.sh

ENV PUID=0 PGID=0 UMASK=022

WORKDIR /opt/synctv

EXPOSE 8080/tcp 8080/udp

VOLUME [ "/opt/synctv" ]

CMD [ "/entrypoint.sh" ]
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ func init() {
home = "~"
}
RootCmd.PersistentFlags().StringVar(&flags.DataDir, "data-dir", filepath.Join(home, ".synctv"), "data dir")
RootCmd.PersistentFlags().StringVarP(&flags.ConfigFile, "config", "f", filepath.Join(flags.DataDir, "config.yaml"), "config file path")
RootCmd.PersistentFlags().StringVarP(&flags.ConfigFile, "config", "f", "", "config file path")
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
ports:
- '8080:8080/tcp'
- '8080:8080/udp'
volumes:
- /opt/synctv:/opt/synctv
environment:
- PUID=0
- PGID=0
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

chown -R ${PUID}:${PGID} /opt/synctv/
chown -R ${PUID}:${PGID} /opt/synctv

umask ${UMASK}

exec su-exec ${PUID}:${PGID} synctv server --env-no-prefix --skip-config
exec su-exec ${PUID}:${PGID} synctv server --env-no-prefix --data-dir /opt/synctv

0 comments on commit 05fbedb

Please sign in to comment.