Skip to content

Commit f70a931

Browse files
authored
Merge pull request #16 from SuperJC710e/main
Changes to Healthcheck to Fix Incorrect Unhealthy State
2 parents 186847f + dbbdd1e commit f70a931

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
# bedrock server
133+
bedrock_server/*

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ RUN apt-get update \
1919

2020
# Install Python dependencies in one layer
2121
COPY requirements.txt .
22-
RUN pip install --no-cache-dir -r requirements.txt
23-
RUN rm requirements.txt
22+
RUN pip install --no-cache-dir -r requirements.txt; \
23+
rm requirements.txt
2424

2525
# Create necessary directories
26-
RUN mkdir -p instance configs
27-
RUN mkdir -p /app/instance/worlds # Create necessary directories for volume mounts
26+
RUN mkdir -p instance configs; \
27+
mkdir -p /app/instance/worlds # Create necessary directories for volume mounts
2828
# TODO: Add mount points for behavior_packs, resource_packs, etc.
2929

3030
# Copy only the necessary files to the container
@@ -33,11 +33,12 @@ COPY bedrock_server/ /app/instance
3333
COPY backend/ /app/
3434

3535
# Expose the required port
36-
EXPOSE 8000
37-
EXPOSE 19132/udp
36+
EXPOSE 8000 \
37+
19132/udp \
38+
19133/udp
3839

3940
# Healthcheck to ensure the container is healthy
40-
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD wget --quiet --tries=1 --spider http://localhost:8000/healthz || exit 1
41+
HEALTHCHECK --interval=1m30s --timeout=30s --start-period=5s --retries=5 CMD wget --quiet --tries=1 --output-document=- http://0.0.0.0:8000/healthz || exit 1
4142

4243
# Define the entry point for the container
4344
CMD ["python", "main.py"]

0 commit comments

Comments
 (0)