Created
March 24, 2020 12:47
-
-
Save dreadfullyposh/5f8a0cbea4d147c5a087bec861380ef1 to your computer and use it in GitHub Desktop.
Example using Docker multi-stage builds
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
version: '3.7' | |
services: | |
web: | |
build: | |
context: ./web/docker | |
target: prod # set the named target here |
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
# Dev - name the stage with `as dev` | |
FROM confluxgroup/php-nginx:7.4 as dev | |
RUN add-apt-repository -y ppa:ondrej/php \ | |
&& apt-get update -y \ | |
&& apt-get install php7.4-sqlite3 -y \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Production - name the stage with `as prod` | |
FROM dev as prod | |
ADD ./redirects.conf /etc/nginx/sites-enabled/ | |
ADD ./expires.conf /etc/nginx/include.d/ | |
ADD ./compression.conf /etc/nginx/include.d/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment