Skip to content

Commit

Permalink
cleanup docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ngn13 committed Nov 21, 2024
1 parent e002db8 commit 991cf9a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@ RUN chmod +x "init.sh"
ENV EZCAT_STATIC_DIR "./static"
ENV EZCAT_PAYLOAD_DIR "./payloads"

ARG API_URL
ENV API_URL $API_URL

ENTRYPOINT ["dumb-init", "./init.sh"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
format:
$(MAKE) -C server format
$(MAKE) -C payloads/stage format
cd app && npm run format

.PHONY: format
6 changes: 3 additions & 3 deletions docker/init.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

# update the API_URL for the frontend APP
if [ ! -z "$API_URL" ]; then
API_URL=$(echo $API_URL | sed 's/\//\\\//g')
find ./static -type f -exec sed -i -e "s/http:\/\/127.0.0.1:5566/$API_URL/g" {} \;
if [ ! -z "$EZCAT_API_URL" ]; then
EZCAT_API_URL=$(echo $EZCAT_API_URL | sed 's/\//\\\//g')
find ./static -type f -exec sed -i -e "s/http:\/\/127.0.0.1:5566/$EZCAT_API_URL/g" {} \;
fi

# run the server
Expand Down
2 changes: 2 additions & 0 deletions server/builder/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func (s *Struct) buildStage(b *build) (err error) {

if s.Config.Debug {
options["STAGE_DEBUG"] = "1"
} else {
options["STAGE_DEBUG"] = "0"
}

if out, err := util.RunBuild(builddir, b.Target.CodeName(), options); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (conf *Struct) Load() error {
case reflect.String:
field_val.SetString(env_val)

case reflect.Uint16:
case reflect.Int:
var env_val_int int
if env_val_int, err = strconv.Atoi(env_val); err != nil {
return fmt.Errorf("%s should be an integer", env_name)
Expand Down

0 comments on commit 991cf9a

Please sign in to comment.