-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (63 loc) · 2.25 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Dockerfile for website-template
#
# Maintainer: Erivando Sena <erivandosena@gmail.com>
#
# Description: Este Dockerfile cria uma imagem para website, um aplicativo da Web em Node.
#
# Build instructions:
# docker build -t erivando/website-node:latest --build-arg 'VERSION=1.0.0' .
# docker push erivando/website-node:latest
#
# Build Arm instructions:
# docker buildx create --name armbuilder
# docker buildx use armbuilder
# docker buildx build --platform linux/amd64,linux/arm64/v8 -t erivando/website-node:latest --build-arg 'VERSION=1.0.0' --push .
#
# Usage:
#
# docker run -it --rm -d -p 8088:80 --name website erivando/website-node:latest
# docker logs -f --tail --until=2s website
# docker exec -it website bash
#
# Dependencies: node:lts
#
# Environment variables:
#
# VERSION: usado na tag de imagem ou como parte dos metadados da mesma.
#
# Notes:
#
# - Este Dockerfile assume que o código do aplicativo está localizado no diretório atual
# - O aplicativo pode ser acessado em um navegador da Web em http://www.updevops.com.br/
# - https://hub.docker.com/r/erivando/website-node
#
# Version: 1.0
FROM node:lts
LABEL \
org.opencontainers.image.vendor="UP DevOps" \
org.opencontainers.image.title="Official Node Docker image" \
org.opencontainers.image.description="Site de Currículos" \
org.opencontainers.image.version="1.0.0" \
org.opencontainers.image.url="https://hub.docker.com/r/erivando/website-node" \
org.opencontainers.image.source="https://github.com/erivandosena/tcc-g8.git" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.author="erivandosena, UP DevOps" \
org.opencontainers.image.company="CICLO 2 AWS 16 G8" \
org.opencontainers.image.maintainer="UP DevOps"
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
software-properties-common \
nano \
sudo \
&& apt-get update && apt-get install -y certbot \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install nodemailer
COPY . .
COPY --chown=node:node . .
RUN echo "node ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER node
RUN mkdir -p .well-known/acme-challenge
EXPOSE 80
CMD [ "node", "app.js" ]