Skip to content

Commit

Permalink
Updated docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
aldwin7894 committed Aug 17, 2022
1 parent 29bc15a commit 0c918ce
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 239 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
FROM ruby:3.1.0-slim-bullseye

ENV NODE_VERSION 14.18.2
ENV NPM_VERSION 6.14.15
ENV YARN_VERSION 1.22
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 14.20.0
ENV NPM_VERSION 8.16.0
ENV YARN_VERSION 1.22.0
ENV BUNDLE_PATH=/gems
ENV PATH="/node-v${NODE_VERSION}-linux-x64/bin:${PATH}"

RUN apt-get update -yq \
&& apt-get install -yq --no-install-recommends \
build-essential \
curl \
libpq-dev \
libjemalloc2 \
postgresql-client \
tar \
git \
tzdata \
&& curl "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" -O \
&& tar xzf "node-v$NODE_VERSION-linux-x64.tar.gz" \
&& npm i -g npm@$NPM_VERSION yarn@$YARN_VERSION \
&& npm cache clean --force \
&& rm -f "/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
&& apt-get clean \
&& curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash \
&& . ~/.bashrc \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& npm i -g npm@$NPM_VERSION yarn@$YARN_VERSION
&& apt-get autoremove

# enable jemalloc
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.615.0)
aws-sdk-core (3.131.6)
aws-partitions (1.619.0)
aws-sdk-core (3.132.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -122,7 +122,7 @@ GEM
fspath (3.1.2)
globalid (1.0.0)
activesupport (>= 5.0)
graphql (2.0.12)
graphql (2.0.13)
graphql-client (0.18.0)
activesupport (>= 3.0)
graphql
Expand Down Expand Up @@ -401,4 +401,4 @@ RUBY VERSION
ruby 3.1.0p0

BUNDLED WITH
2.3.14
2.3.20
37 changes: 5 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,43 @@ version: "3.9"
services:
db:
image: postgres:latest
restart: unless-stopped
restart: always
environment:
- TZ
- POSTGRES_PASSWORD
- POSTGRES_DB
ports:
- "5432:5432"
volumes:
- "dbdata:/var/lib/postgresql/data"
env_file: .env
redis:
image: redis:latest
command: redis-server
restart: unless-stopped
restart: always
environment:
- TZ
ports:
- "6379:6379"
volumes:
- 'redis:/data'
env_file: .env
webpacker:
image: aldwin7894/aldwin7894:dev
command: ["npm", "run", "webpack-dev"]
restart: unless-stopped
ports:
- "3035:3035"
- "8080:8080"
environment:
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0
- NODE_ENV
- RAILS_ENV
volumes:
- .:/app
env_file: .env
web:
build: .
container_name: aldwin7894
image: aldwin7894/aldwin7894:dev
restart: unless-stopped
image: aldwin7894/aldwin7894:prod
restart: always
depends_on:
- db
- redis
- webpacker
ports:
- "3000:3000"
environment:
- "DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}"
- REDIS_URL=redis://redis:6379
- WEBPACKER_DEV_SERVER_HOST=webpacker
- TZ
- RAILS_MASTER_KEY
- RAILS_ENV
- NODE_ENV
- LASTFM_API_KEY
- LASTFM_API_SECRET
- NEW_RELIC_APP_NAME
- NEW_RELIC_AGENT_ENABLED
- NEW_RELIC_LICENSE_KEY
- S3_BUCKET_ENV
- LOGRAGE
- ANILIST_CLIENT_ID
- ANILIST_CLIENT_SECRET
- FORCE_SSL
- RAILS_ASSET_HOST
volumes:
- .:/app
- ruby-gems:/gems
Expand Down
13 changes: 13 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"baseUrl": ".",
"moduleResolution": "Node",
"paths": {
"~/*": ["app/frontend/*"]
}
},
"include": ["app", "app/frontend"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 0c918ce

Please sign in to comment.