This repository was archived by the owner on Oct 26, 2025. It is now read-only.
forked from MarczalTSIGP/SGTCC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
127 lines (114 loc) · 4.34 KB
/
Dockerfile
File metadata and controls
127 lines (114 loc) · 4.34 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Base Image
FROM ruby:2.7.2
# Encoding
# C.UTF8 locale supports Computer English language
ENV LANG C.UTF-8
# Default user and group id. This is important to avoid permission errors.
#
# All Linux users have a user ID and a group ID and a unique numerical
# identification number called a userid (UID) and a groupid (GID) respectively.
# Groups can be assigned to logically tie users together for a common security,
# privilege and access purpose. It is the foundation of Linux security and
# access.
ARG USER_ID=1000
ARG GROUP_ID=1000
# -q, --quiet
# Quiet. Produces output suitable for logging, omitting progress indicators.
# More q's will produce more quiet up to a maximum of two. You can also use
# -q=# to set the quiet level, overriding the configuration file. Note that
# quiet level 2 implies -y, you should never use -qq without a no-action
# modifier such as -d, --print-uris or -s as APT may decided to do something
# you did not expect.
#
# build-essential is a package which contains references to numerous
# packages needed for building software in general, it contais g++, gcc,
# make tool between others package
#
# curl is used in command lines or scripts to transfer data
#
# libpq-dev are header files and static library for compiling C programs to
# link with the libpq library in order to communicate with a PostgreSQL
# database backend.
#
# libxml2-dev Development files for the GNOME XML library
#
# libxslt1-dev XSLT is an XML language for defining transformations of XML
# files from XML to some other arbitrary format, such as XML, HTML, plain
# text, etc.
#
# imagemagick is a free and open-source software suite for displaying,
# creating, converting, modifying, and editing raster image.
#
# git
# Git is a distributed version-control system for tracking changes in
# source code during software development.
#
# sudo
# sudo is a program for Unix-like computer operating systems that
# allows users to run programs with the security privileges of another user,
# by default the superuser.
#
# ssh
# Secure Shell is a cryptographic network protocol for operating network
# services securely over an unsecured network.
#
# procps
# This package provides command line and full screen utilities for b
# procfs, a "pseudo" file system dynamically generated by the kernel to
# provide information about the status of entries in its process table
# (such as whether the process is running, stopped, or a "zombie").
# .
# It contains free, kill, pkill, pgrep, pmap, ps, pwdx, skill, slabtop,
# snice, sysctl, tload, top, uptime, vmstat, w, and watch.
RUN apt-get update -qq && \
apt-get install -y curl \
libpq-dev \
libxml2-dev \
libxslt1-dev \
imagemagick \
git \
sudo \
ssh \
rsync \
procps \
cron \
vim
# --------------------------
# INSTALL LAST VERSION OF postgresql-client
# --------------------------
RUN apt-get install -y lsb-release
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt-get install wget ca-certificates && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update -qq && \
apt-get install -y postgresql-client
# --------------------------
# INSTALL NODEJS BY NVM
# --------------------------
ARG NODE_VERSION=10.24.1
ARG NVM_DIR=/usr/local/nvm
# https://github.com/creationix/nvm#install-script
RUN mkdir $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# confirm installation
RUN node -v
RUN npm -v
# --------------------------
# end NODEJS
# --------------------------
# Install YARN
RUN npm install -g yarn
# Define environment variables
ENV APP_NAME sgtcc
ENV APP /var/www/${APP_NAME}
ENV BUNDLE_PATH /bundle/vendor
RUN mkdir -p $APP \
&& mkdir -p $BUNDLE_PATH
# Set working directory
WORKDIR $APP
# Install bundler and rails
RUN gem install bundler -v 2.3.7 \
&& gem install rails -v 6.0.3.2