mirror of
https://github.com/hexboy/maven-mirror-tool.git
synced 2025-04-09 16:29:10 +00:00
dockerize th repo
This commit is contained in:
parent
d325bc50e4
commit
86adff94cb
3 changed files with 75 additions and 0 deletions
35
.dockerignore
Normal file
35
.dockerignore
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Include any files or directories that you don't want to be copied to your
|
||||
# container here (e.g., local build artifacts, temporary files, etc.).
|
||||
#
|
||||
# For more help, visit the .dockerignore file reference guide at
|
||||
# https://docs.docker.com/go/build-context-dockerignore/
|
||||
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/.next
|
||||
**/.cache
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/compose.y*ml
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
**/build
|
||||
**/dist
|
||||
**/local-cache
|
||||
LICENSE
|
||||
README.md
|
31
Dockerfile
Normal file
31
Dockerfile
Normal file
|
@ -0,0 +1,31 @@
|
|||
ARG NODE_VERSION=22
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine
|
||||
|
||||
# Use production node environment by default.
|
||||
ENV NODE_ENV production
|
||||
|
||||
# install and use yarn 4.x
|
||||
RUN corepack prepare yarn@4.3.1
|
||||
|
||||
# Run as a root user.
|
||||
USER root
|
||||
|
||||
# Init local-cache dir
|
||||
RUN mkdir -p /home/node/app/local-cache
|
||||
RUN chown -R node:node /home/node/app
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /home/node/app
|
||||
|
||||
# Run the application as a non-root user.
|
||||
USER node
|
||||
|
||||
# Copy the rest of the source files into the image.
|
||||
COPY --chown=node . .
|
||||
|
||||
# Expose the port that the application listens on.
|
||||
EXPOSE 8008
|
||||
|
||||
# Run the application.
|
||||
CMD yarn && yarn run pm2 start --attach --env ${NODE_ENV}
|
9
compose.yaml
Normal file
9
compose.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
services:
|
||||
mirror:
|
||||
image: hexboy2011/maven-mirror-tool
|
||||
build:
|
||||
context: .
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
ports:
|
||||
- 8008:8008
|
Loading…
Add table
Reference in a new issue