Skip to content

Commit

Permalink
Updates dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Jan 27, 2025
1 parent a64646d commit 912dae0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl --fail http://localhost:8080/health || exit 1

# Ensure the logfile directory exists with proper permissions
RUN mkdir -p /usr/src/app/data/logs/docker/ && chmod -R 0755 /usr/src/app/data/logs/docker/
RUN mkdir -p /usr/src/app/data/logs/docker && chmod -R 0755 /usr/src/app/data/logs/docker

CMD ["sh", "-c", "node /usr/src/app/app/index.js >> /usr/src/app/data/logs/docker/app.log 2>&1"]
# 1.5gb max memory is 75% of the 2gb limit for the container
CMD ["sh", "-c", "node --max-old-space-size=1536 /usr/src/app/app/index.js >> /usr/src/app/data/logs/docker/app.log 2>&1"]
8 changes: 8 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ GREEN_CONTAINER="blot-container-green"
BLUE_CONTAINER_PORT=8088
GREEN_CONTAINER_PORT=8089

# To determine the user ID and group ID of the user running the container
# ssh into the server and run `id ec2-user` and you'll see something like:
# uid=1000(ec2-user) gid=1000(ec2-user) groups=1000(ec2-user),4(adm),10(wheel),190(systemd-journal),991(docker)
# This means the user ID is 1000 and the group ID is 1000 so the
# resulting user:group is 1000:1000
BLOT_USER=1000:1000

# Define the docker run command template with placeholders
DOCKER_RUN_COMMAND="docker run --pull=always -d \
--user $BLOT_USER \
--name {{CONTAINER_NAME}} \
-p {{CONTAINER_PORT}}:8080 \
--env-file /etc/blot/secrets.env \
Expand Down

0 comments on commit 912dae0

Please sign in to comment.