Created
May 28, 2020 11:13
-
-
Save acerzhou/052eb0913ed78edc210126a5b40495ab to your computer and use it in GitHub Desktop.
[Docker] some docker examples #docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1: Specify the parent image for the new image | |
FROM ubuntu:18.04 | |
# Step 2: Update OS packages and install additional software | |
RUN apt -y update && apt install -y wget nginx software-properties-common apt-transport-https \ | |
&& wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ | |
&& dpkg -i packages-microsoft-prod.deb \ | |
&& add-apt-repository universe \ | |
&& apt -y update \ | |
&& apt install -y dotnet-sdk-3.0 | |
# Step 3: Configure Nginx environment | |
CMD service nginx start | |
# Step 4: Configure Nginx environment | |
COPY ./default /etc/nginx/sites-available/default | |
# STEP 5: Configure work directory | |
WORKDIR /app | |
# STEP 6: Copy website code to container | |
COPY ./website/. . | |
# STEP 7: Configure network requirements | |
EXPOSE 80:8080 | |
# STEP 8: Define the entry point of the process that runs in the container | |
ENTRYPOINT ["dotnet", "website.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment