Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize net8 Dockerfile changes #4157

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,26 @@ RUN dotnet publish ./ACE.Server/ACE.Server.csproj -a $TARGETARCH -c release -o /
# final stage/image
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy
ARG DEBIAN_FRONTEND="noninteractive"
WORKDIR /ace
WORKDIR /home/app/ace

# install net-tools (netstat for health check) & cleanup
RUN apt update && \
apt install --no-install-recommends -y \
RUN apt-get update && \
apt-get install --no-install-recommends -y \
net-tools && \
apt clean && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

# add app from build
COPY --from=build /ace .

# set correct permissions for app directory and files
RUN chown -R app:app /home/app/ace/

# switch to and run app from non-root user
USER app
ENTRYPOINT ["dotnet", "ACE.Server.dll"]

# ports and volumes
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This Dockerfile, specific to arm64 should be no longer needed. Leaving in place for legacy purposes for now.
# This Dockerfile, specific to arm64, should be no longer needed. Leaving in place for legacy purposes.

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
ARG TARGETARCH
WORKDIR /Source

# copy csproj and restore as distinct layers
Expand All @@ -27,10 +28,10 @@ ARG DEBIAN_FRONTEND="noninteractive"
WORKDIR /ace

# install net-tools (netstat for health check) & cleanup
RUN apt update && \
apt install --no-install-recommends -y \
RUN apt-get update && \
apt-get install --no-install-recommends -y \
net-tools && \
apt clean && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.arm64
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This docker-compose file, specific to arm64, should be no longer needed. Leaving in place for legacy purposes.

#version: '3'
services:

Expand All @@ -23,7 +25,8 @@ services:
dockerfile: Dockerfile.arm64
image: acemulator/ace:latest-arm64
depends_on:
- ace-db
ace-db:
condition: service_healthy
container_name: ace-server
env_file:
- docker.env
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ services:
build: .
image: acemulator/ace:latest
depends_on:
- ace-db
ace-db:
condition: service_healthy
container_name: ace-server
env_file:
- docker.env
Expand Down