Skip to content

Commit

Permalink
Finalize net8 Dockerfile changes (#4157)
Browse files Browse the repository at this point in the history
* Finalize net8 Dockerfile changes

* Update docker-compose.arm64

* Update docker-compose.yml

* Update Dockerfile

* Update docker-compose.arm64

* Update Dockerfile
  • Loading branch information
LtRipley36706 authored Apr 24, 2024
1 parent 49d55aa commit 71cf273
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
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

0 comments on commit 71cf273

Please sign in to comment.