This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
#Creates a layer from node:alpine image.
|
||||
FROM node:alpine
|
||||
|
||||
#Creates directories
|
||||
RUN mkdir -p /usr/src/app
|
||||
|
||||
#Sets an environment variable
|
||||
ENV PORT 3000
|
||||
|
||||
#Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD commands
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
#Copy new files or directories into the filesystem of the container
|
||||
COPY package.json /usr/src/app
|
||||
COPY package-lock.json /usr/src/app
|
||||
|
||||
#Execute commands in a new layer on top of the current image and commit the results
|
||||
RUN npm install
|
||||
|
||||
##Copy new files or directories into the filesystem of the container
|
||||
COPY . /usr/src/app
|
||||
|
||||
#Execute commands in a new layer on top of the current image and commit the results
|
||||
RUN npm run build
|
||||
|
||||
#Informs container runtime that the container listens on the specified network ports at runtime
|
||||
EXPOSE 3000
|
||||
|
||||
#Allows you to configure a container that will run as an executable
|
||||
ENTRYPOINT ["npm", "run"]
|
||||
|
||||
22
docker-compose.yml
Normal file
22
docker-compose.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
peroxy-site:
|
||||
build:
|
||||
context: .
|
||||
dommand: start
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.peroxy-site.entrypoints=https"
|
||||
- "traefik.http.routers.peroxy-site.rule=Host(`peroxy.dev`)"
|
||||
- "traefik.http.routers.peroxy-site.tls=true"
|
||||
- "traefik.http.routers.peroxy-site.tls.certresolver=http"
|
||||
- "traefik.http.routers.peroxy-site.service=peroxy-site"
|
||||
- "traefik.http.routers.peroxy-site.loadbalancer.server.port=3000"
|
||||
- "traefik.docker.network=proxy"
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
Reference in New Issue
Block a user