Files
boc/vims-backend/k8s/init-db.yaml
T
Bernt 6de2455917 v1.2.0: Add Global Markets footer, translated to 9 languages
- Added GLOBAL_MARKETS_TITLE to all translation files
- Updated footer with 12 markets (4 active + 8 upcoming)
- Translated market section to: zh-cn, zh-tw, ja, ko, th, vi, id, ms, hi
- Built and deployed to production
- CloudFront invalidation: I3RTMXVFDJXWLG3SYX208OP1CC
2026-07-08 19:56:03 +00:00

47 lines
1.4 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: vims-init-db
namespace: vims
spec:
template:
spec:
containers:
- name: init-db
image: 155407238699.dkr.ecr.eu-north-1.amazonaws.com/vims:prod
command: ["node", "-e"]
args:
- |
const { Sequelize } = require('sequelize');
const config = {
host: process.env.DB_HOST || 'vims-postgres.vims.svc.cluster.local',
port: process.env.DB_PORT || 5432,
database: process.env.DB_NAME || 'vims',
username: process.env.DB_USER || 'postgres',
password: process.env.DB_PASSWORD || 'postgres',
dialect: 'postgres'
};
const sequelize = new Sequelize(config.database, config.username, config.password, {
host: config.host,
port: config.port,
dialect: config.dialect,
logging: false
});
sequelize.sync({ force: true }).then(() => {
console.log('Database synced successfully');
process.exit(0);
}).catch(err => {
console.error('Sync failed:', err);
process.exit(1);
});
envFrom:
- configMapRef:
name: vims-config
env:
- name: DB_PASSWORD
value: "postgres"
restartPolicy: Never
backoffLimit: 4