NodeJS Dockerfile:
1
2
3
4
5
6
7
8
9
10
11
12
FROM node:14
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY .npmrc .npmrc
ENV NODE_ENV=production
RUN npm install
RUN npm run build
CMD npm run start
GO Dockerfile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
FROM golang:1.16-alpine
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o /docker-gs-ping
EXPOSE 8080
CMD [ "/docker-gs-ping" ]
PHP Dockerfile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM composer:2.0 as vendor
WORKDIR /app
COPY database/ database/
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install \
--no-interaction \
--no-plugins \
--no-scripts \
--no-dev \
--prefer-dist
COPY . .
RUN composer dump-autoload
FROM php:8.1.4-apache
WORKDIR /var/www/php
COPY --from=vendor app/vendor/ ./vendor/
COPY . .